Thomas Hruska wrote: > Tamas Marki wrote: >> On Thu, Mar 13, 2008 at 6:22 PM, mikejd42 <[EMAIL PROTECTED]> wrote: >>> I have two threads both kicked off at the same time. Thread one feeds >>> information info a structure while thread two reads that information. >>> >>> I would imagine that there is some kind of thread lock that I can call >>> to keep thread 2 at bay until thread one has updated the structure? >> You are looking for mutexes or semaphores. Since you didn't specify >> what threading mechanism are you using, I can't be more specific... >> Hope this helps though. > > Or events/conditionals. Depends on OS/threading architecture. A mutex > is the general-purpose solution but tends to be fairly heavyweight.
I should add that the general-purpose solution is usually a good first pass. Optimize later. -- Thomas Hruska CubicleSoft President Ph: 517-803-4197 *NEW* MyTaskFocus 1.1 Get on task. Stay on task. http://www.CubicleSoft.com/MyTaskFocus/
