Does BMax have multithreading yet?

BlitzMax Forums/BlitzMax Programming/Does BMax have multithreading yet?

Scienthsine(Posted 2009) [#1]
Gah, searches come up with all the old topics about it. I saw that the new garbage collector is threaded... so can someone clue me in? I haven't been around in a while... so kinda lost.


plash(Posted 2009) [#2]
Yes... it does.


Scienthsine(Posted 2009) [#3]
So how does it work? Can you spawn threads from blitz code directly, or is it just thread safe? Is there any kind of documentation I can look at?


plash(Posted 2009) [#4]
Taken (and modified a bit) from 'blitzmax/samples/threads/threads.bmx':



Scienthsine(Posted 2009) [#5]
Alright! I've been in the electronics world for a while... but maybe it's time to dust off BMax for a bit of playing around with! Thanks Plash, exactly what I was wanting to know.


K@li(Posted 2009) [#6]
Global Mutex:TMutex = CreateMutex()


error : Tmutex not found !!


BlitzSupport(Posted 2009) [#7]
K@li: Turn on Program menu -> Build Options -> Threaded Build. Make sure you're using the latest BlitzMax release too!


K@li(Posted 2009) [#8]
Great !! thanks....


Scienthsine(Posted 2009) [#9]
Ok, so there's decent documentation on threads, mutexes, and semophores, but nothing really about CondVars and a few new functions: AtomicAdd and AtomicSwap. Do these two work on variables without the need to use a mutex?