W
whansen_at_corporate-image_dot_com
I'm trying to find the best way to do something. I've got 50 processes
(may have 200 soon) that need to broadcast simple messages to each of
them. I tried doing this with sockets, but although I was able to get
them to read a socket without halting succesfully I found that when
one process reads a socket it removes the message from the socket and
the other processes don't see it. My current solution works using
IPC::Shareable, but is slow and hogs memory as well as the CPU.
Shareable lets you set a variablle that multiple programs can read and
write to. In my case they read and write to the list that they all run
off.
Basicly each process is iterating over a list (array) and every so
often a process gets a result that means that item no longer needs to
be ran, so it should remove it from it's list and notify the other
processes so that they can remove it from theirs as well. Whith
IPC::Shareable it works nicely as when one process removes the item,
all the others have it removed also, but it appers that the shareable
module is slowing things down considerablly (CPU usage doubled).
If someone could point me in the right direction, that would be great.
I have an idea for speeding up shareable a little, but it's still not
going to be fast.
(may have 200 soon) that need to broadcast simple messages to each of
them. I tried doing this with sockets, but although I was able to get
them to read a socket without halting succesfully I found that when
one process reads a socket it removes the message from the socket and
the other processes don't see it. My current solution works using
IPC::Shareable, but is slow and hogs memory as well as the CPU.
Shareable lets you set a variablle that multiple programs can read and
write to. In my case they read and write to the list that they all run
off.
Basicly each process is iterating over a list (array) and every so
often a process gets a result that means that item no longer needs to
be ran, so it should remove it from it's list and notify the other
processes so that they can remove it from theirs as well. Whith
IPC::Shareable it works nicely as when one process removes the item,
all the others have it removed also, but it appers that the shareable
module is slowing things down considerablly (CPU usage doubled).
If someone could point me in the right direction, that would be great.
I have an idea for speeding up shareable a little, but it's still not
going to be fast.