multi-threaded, multi-process producer/consumer example?

Discussion in 'C Programming' started by ian douglas, Jul 29, 2004.

  1. ian douglas

    ian douglas Guest

    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
     
    ian douglas, Jul 29, 2004
    #1
    1. Advertising

  2. ian douglas <> spoke thus:

    > 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.


    (Stop right there and head over to comp.threads.)

    Your post is off-topic for comp.lang.c. Please visit

    http://www.ungerhu.com/jxh/clc.welcome.txt
    http://www.eskimo.com/~scs/C-faq/top.html
    http://benpfaff.org/writings/clc/off-topic.html

    for posting guidelines and frequently asked questions. Thank you.

    --
    Christopher Benson-Manica | I *should* know what I'm talking about - if I
    ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
     
    Christopher Benson-Manica, Jul 29, 2004
    #2
    1. Advertising

  3. ian douglas

    Randy Howard Guest

    In article <cebiet$epq$>, says...
    > ian douglas <> spoke thus:
    >
    > > 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.

    >
    > (Stop right there and head over to comp.threads.)


    comp.programming.threads

    --
    Randy Howard
    To reply, remove FOOBAR.
     
    Randy Howard, Jul 30, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark McKay
    Replies:
    0
    Views:
    451
    Mark McKay
    Dec 9, 2003
  2. Buck Turgidson

    Simple Producer/Consumer Thread Question

    Buck Turgidson, Feb 17, 2004, in forum: Java
    Replies:
    5
    Views:
    542
    Tony Dahlman
    Feb 21, 2004
  3. Usenet Poster!!!
    Replies:
    4
    Views:
    1,860
    Eric Sosman
    Sep 30, 2004
  4. Jeff
    Replies:
    4
    Views:
    681
    xarax
    Oct 22, 2004
  5. Replies:
    0
    Views:
    1,093
Loading...

Share This Page