Name: Anonymous 2006-11-05 9:50
Okay, lets say I have a list of objects. Each object can perform an action every five seconds, the time it takes to perform an action is random and might very well be more than five seconds.
How do I keep all the objects performing their actions as soon as possible in order to get the best throughput? Threads, I suppose, but what should I store the objects in, and how do I check when one is done.
Perhaps if I put a mutex (I hope that's the right name) in each object, along with a timestamp. A priority queue? If so, do I sort on the timestamps? I guess I do, thanks for the help!
How do I keep all the objects performing their actions as soon as possible in order to get the best throughput? Threads, I suppose, but what should I store the objects in, and how do I check when one is done.
Perhaps if I put a mutex (I hope that's the right name) in each object, along with a timestamp. A priority queue? If so, do I sort on the timestamps? I guess I do, thanks for the help!