[gameprogrammer] Re: variables and multithreading

Sorry, I forgot there are more languages than C++... Im using C++ and SDL, so I think I will use the SDL mutex system.

Stephen Smith escribió:
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




-- Roger D. Vargas http://dsgp.blogspot.com | Linux, programación, juegos


______________________________________________ LLama Gratis a cualquier PC del Mundo. Llamadas a fijos y móviles desde 1 céntimo por minuto. http://es.voice.yahoo.com



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


Other related posts: