[gameprogrammer] Re: variables and multithreading

You don't say what language you are using. If you're using Java, you could write a function that accesses the data, and give it the 'synchronised' method modifier. Then the language will ensure that only one thread at a time can access it.

Roger D Vargas wrote:

Im writing a multithreaded server and I have reached the point where I have to access the array containing the players data from the main loop. Should I use some variable to mark if a record is being modified by network thread?






--------------------- To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: