in reply to Help on Understanding Locks in Multithreading

Threads: why locking is required when using shared variables

For what it is worth, I use threads without locking, by setting it up so each thread controls it's own output shared variables that are readonly from the outside, and the input shared vars are readonly from inside the thread. It's like setting up "one way streets". The few extra shared variables needed is more than made up for by not needing traffic control (locking).


I'm not really a human, but I play one on earth My Petition to the Great Cosmic Conciousness
  • Comment on Re: Help on Understanding Locks in Multithreading