in reply to Re: Performance and CPU load: sysread, IO::Select and/or Storable::thaw
in thread Performance and CPU load: sysread, IO::Select and/or Storable::thaw
Your reply makes perfect sense. The parent runs for quite a long time and starts only under very specific circumstances. It's also working with some legacy logic, so it's hard to test. I have, however, modified the child to remove the 5 second time out from can_read(5) because the IO::Select docs say:
If "TIMEOUT" is not given and any handles are registered then the call will block.
I also added the line:
my ($handle) = $select->can_read(5); $handle->blocking(1);
This had no effect either, presumably because the handle to \*STDIN had already been created. I also tried setting that handle to blocking(1) before any loops start, which also had no effect:
my @handles = $select->handles(); $handles[0]->blocking(1);
I'm concerned that even if I set the read handle to block in the parent when open2() is called it still won't work. Perhaps I need both the write handle and read handle to block?
Forgive my IPC ignorance here, but what I'm trying does not seem to match what I've read and I tried to do an extremely thorough job of research and testing.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Performance and CPU load: sysread, IO::Select and/or Storable::thaw
by jethro (Monsignor) on Jun 29, 2010 at 18:21 UTC | |
by DBX (Pilgrim) on Jun 29, 2010 at 19:42 UTC | |
by jethro (Monsignor) on Jun 30, 2010 at 09:47 UTC | |
by DBX (Pilgrim) on Jun 30, 2010 at 13:49 UTC |