Global variables and threads

My efforts at self-educating myself in multicore programming has been wading through all the jargon, and trying to find good examples.

I settled on doing things the Erlang way, and started this thread Erlang "ping pong" concurrent programming example translated into SWI Prolog a while back doing the simple examples in SWI Prolog.

I actually find SWI Prolog’s threads and message queues easier to understand than Erlang’s Node ! Message, receive ... end syntax which by abstracting away details, means I have no idea how to get lots of processes to listen to the same message queue (with whichever one is free and quickest handling the job) in Erlang as can easily be done in SWI Prolog for concurrent maplist.

The Erlang philosophy is to simply ignore all the mutex stuff, and since I don’t understand it anyway, that’s the route I’ve taken. I’d assume there must be some way for a thread updating shared data to let the other threads know by messaging.