I
ian douglas
I have one process that will be multi-threaded. The parent (A) will
sit and deal with TCP/IP issues, and feed data to its child process
(B) via shared memory. I need assistance in finding a good example of
(B) pausing (not in a busy-wait loop) until it gets a signal from (A)
that data is ready.
That the child process (B) will then have a shared memory segment with
a second running process (C), where (B) will be the producer for (C),
so (B) must also be able to get a signal from (C) to pass it more data
once (C) is ready to accept more data.
(C) then is a consumer for (B), and a producer for a thread (E) of
another separate process (D). (C) should also sit in a loop (not
hogging up cpu cycles), to get signals either from (B) or (E) to do
its work.
(D) that will deal with another TCP/IP connection, and will consume
data from its child (E). This child (E) will be a consumer for (C) and
a producer for (D).
Specifically what I need to find is a clear, documented example of how
a process can sit quietly, without hogging up CPU cycles, and wait for
a signal before acting on that signal. Having an example for dealing
with a signal from a parent or child thread, and having another
example for dealing with a signal from an external process (passed by
the OS?), is what I'm looking for.
Test platform is Fedora Core 2, 2.6.6 kernel. Production platform will
likely be RedHat 8.0 running some variant of the 2.4 kernel.
Thanks for any tips or samples.
-id
sit and deal with TCP/IP issues, and feed data to its child process
(B) via shared memory. I need assistance in finding a good example of
(B) pausing (not in a busy-wait loop) until it gets a signal from (A)
that data is ready.
That the child process (B) will then have a shared memory segment with
a second running process (C), where (B) will be the producer for (C),
so (B) must also be able to get a signal from (C) to pass it more data
once (C) is ready to accept more data.
(C) then is a consumer for (B), and a producer for a thread (E) of
another separate process (D). (C) should also sit in a loop (not
hogging up cpu cycles), to get signals either from (B) or (E) to do
its work.
(D) that will deal with another TCP/IP connection, and will consume
data from its child (E). This child (E) will be a consumer for (C) and
a producer for (D).
Specifically what I need to find is a clear, documented example of how
a process can sit quietly, without hogging up CPU cycles, and wait for
a signal before acting on that signal. Having an example for dealing
with a signal from a parent or child thread, and having another
example for dealing with a signal from an external process (passed by
the OS?), is what I'm looking for.
Test platform is Fedora Core 2, 2.6.6 kernel. Production platform will
likely be RedHat 8.0 running some variant of the 2.4 kernel.
Thanks for any tips or samples.
-id