Threading Crash

BlitzMax Forums/BlitzMax Programming/Threading Crash

BLaBZ(Posted 2010) [#1]
If you're attempting to read an object while another thread is manipulating it while the game crash?


xlsior(Posted 2010) [#2]
Not sure what you mean here -- are you asking if it -will- crash?


H&K(Posted 2010) [#3]
I don't think has to no.

My understanding is as long as only one thread has the ability to change the info, any number of threads can "look" at the info

However lets say you have an object that "counts the number of times it is accessed, then even tho you are only "reading" you are also changing as well. And I think this is a no no. And what happens if the "changing" bit moves it in memory and the reading bit already has the pointer? Or the changing bit deletes it?

See this thread
http://www.blitzbasic.com/Community/posts.php?topic=91458


Gabriel(Posted 2010) [#4]
If you're attempting to read an object while another thread is manipulating it while the game crash?


To quote Reverend Lovejoy, "Short answer yes with an if. Long answer no with a but."

This is a good article about concurrency in general terms:

http://msdn.microsoft.com/en-us/magazine/cc163744.aspx


ima747(Posted 2010) [#5]
If you read an object while it is being altered it could crash depending on how the object is being manipulated. E.g. A pixmap is being read (drawn or copied) while it's data is being altered, you will either get weird results or it could potentially crash if pointers change during the manipulation.

Multiple reads and ONLY reads are safe, everything else can cause touble.