Creating a working fork pool class

Hello,

I am trying to create a fork pool class to help processing large amount
of data in parallel on multiple cores. I had a looking at existing
solutions like the gems fork, parallel, forkoff and forkmanager, but I
failed to get these to work the way I want - so I am rolling my own.
Unfortunately, it is not going very well. First of all, the code does
not appear to execute in parallel, and secondly, I foresee problems with
blocking of IPC IO for processing of large amounts of data. Here is what
I have written so far:

https://gist.github.com/maasha/21fb319b3853b47152ef

For some reason forking is complex even though this technique is vital.
So I need some pointers?

Cheers,

Martin

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs