Hello. I have questions regarding Haxe (Neko target), and Multi-Threading.
So in haxe, this:
var cpt:Int;
Thread.create( function() { while( true ) cpt++; } ); //function1
Thread.create( function() { while( true ) cpt--; } ); //function2
builds, run, and work. Right? Except if both Thread try to access at the same time, and then anything goes. So it's a no go.
But what about objects with the mutex mechanic?
If I have a Buffer class ( some FIFO string array with a mutex to lock on writing and reading ), can I just read it from within the created thread, or do I have to send it through sendMessage?
Just reading it seams to work, from my tests. But I don't have the means to stress-test it with a lot of connections, and I am afraid it just works now as a simple boolean lock, while I suppose mutex are more reliable.
Anybody?
Thanks.