Original program idea:
Write a ruby program that checks the integrity of all my FLAC music files, and that makes use of my MacBooks Core Duo
CPU. Since Ruby doesn't support native threads, I decided to use the Slave library.
Problem:
I start 3 Slave servers:
worker1 and worker2 both query the filename server to get the next filename to process.
On Mac OS 10.4.10, ruby 1.8.6 (Locomotive or MacPorts, same problem) the second worker server process never starts,
it seems to sleep forver, and I don't see my programming mistake.
The same problem occurs on Ubuntu Feisty.
However: IF you start the 2nd worker after the first worker completed its work, it runs without problem.
And: If you disable the call to the filename server, both workers run in parallel, too, without deadlocking. So the
problem has something to do with both workers trying to access the same filename server.
Any ideas?
Note:
When implementing the same logic using drb directly (3 executable scripts that start the respective drb servers manually,
using Unix domin socktes), everything works perfectly.
So the problem could be caused by the way Slave initialized DRB? Or am I making a mistake? |