Hi, I'm working on a program that should launch, spawn two threads, each with a zeromq connection, where those threads ping the zmq channel repeatedly. The main thread just sits and waits.
If I launch one thread, or the other (lines 13 & 14), and comment the other one out, it runs as expected.
But if I attempt to launch both, both build themselves, and run one call of themselves, but then it seems that one or the other thread "wins", and the other never gets to run again. Most of the time it's the first one launched that wins, but not always. See the output for an example.
Adding explicit yield calls, using forkOS vs forkIO, and moving around of where I make the ZMQ context & socket (into and out of the threads) don't seem to help.
What am I missing? How can I get these threads to play nice with each other?
Thanks!