well, first you would need to have actual processes, I suppose. could you just try and explain what exactly it is that you are trying to achieve?
stultuske
Industrious Poster
4,382 posts since Jan 2007
Reputation Points: 1,318
Solved Threads: 610
Skill Endorsements: 24
What does a list of Strings have to do with monitoring Threads?
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
You could create a Map with process name as key and its status as value. The first time you process a record for a given process name you will add it to the Map with a status of "started". When you find its "finished" record you update the status. When all the data is processed you can check all the entries for status not "finished".
If you find a "started" record for a process that's already in the map then you know it's been started twice.
JamesCherrill
... trying to help
8,527 posts since Apr 2008
Reputation Points: 2,583
Solved Threads: 1,456
Skill Endorsements: 30
HashMaps are a generally very useful tool - no need to avoid them! If you need thread-safe map then you can wrap the class - but there's nothing in your original post about thread-safe.
You wanted to know about processes that have started but not finished - these will be all the entries in the map that still have a status of "started" - you can find them with a simple loop thru the map.
You wanted to check that a process can not start again if it already started. That means when you try to add it to the Map it's already there. There's a map method for that.
JamesCherrill
... trying to help
8,527 posts since Apr 2008
Reputation Points: 2,583
Solved Threads: 1,456
Skill Endorsements: 30
@NormR1: nothing at all. we were just pointing out that printing a String is not the same as starting a process
stultuske
Industrious Poster
4,382 posts since Jan 2007
Reputation Points: 1,318
Solved Threads: 610
Skill Endorsements: 24
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16