If you wanted to use a thread that would loop through a string array list of items and then process each one by launching another thread that does that processing and wait for that thread to complete before launching that processing thread again with the next item in the list.
The rationale for doing it this way is if I do it all in a single thread the processing slows to a crawl and eventually crashes if the list is long. I have been unable to resolve the cause of the slow down so it makes sense to me to launch the thread to do the processing for each individual item in a separate instance serially because of sending the processed data to an external system requires a pause to allow the remote system to ingest and use the data sent so the thread needs to sleep for 10 seconds before ending and somehow notifying the looping thread to start the next item.
My efforts so far have been unreliable at in the waiting part of the 1st tread for 2nd thread completion. I’m looking for ideas of how you would tackle this scenario. It doesn’t have to use two threads, that is just my current approach.
11 posts - 5 participants