I’m implementing a producer consumer pattern in julia. Each producer will be pushing things on a queue and each consumer will be poping them off. I’d like each producer and each consumer to run in a different execution thread (or process). Any thoughts on the best way to implement this? Below are my current thoughts (not yet tried):
- It seems that the thread infrastructure in v0.6 doesn’t easily support this.
- It seems it’s easiest to use SharedArray’s for the queue with processes for the producers and consumers.
- Do I need to use synchronization with SharedArray’s? I assume push! and pull! are not atomic. I see that julia has synchronization primitives but they seem to be for threads rather than proceses.