On 12/6/08, Roland Mainz <roland.mainz at nrubsig.org> wrote:
>
>  Hi!
>
>  ----
>
>  Is there a way that multiple proceses can write to the same pipe fd but
>  keep their writes "atomic" (regardless of the size, e.g. the writes may
>  be 1 byte or 300GB), e.g. that the data (or better "record") being
>  written appears in one piece ?
>
>  For example:
>  process 1 writes "aaaaaaaa", process 2 writes "bbbbbbb" and process 3
>  writes "cccccccccccccc" to a single pipe. The consumer reading from the
>  pipe should get either:
>  -- snip --
>  "aaaaaaaabbbbbbbcccccccccccccc"
>  "aaaaaaaaccccccccccccccbbbbbbb"
>  "bbbbbbbccccccccccccccaaaaaaaa"
>  "bbbbbbbaaaaaaaacccccccccccccc"
>  "ccccccccccccccaaaaaaaabbbbbbb"
>  "ccccccccccccccbbbbbbbaaaaaaaa"
>  etc.
>  -- snip --
>
>  ... but never something like...
>  -- snip --
>  "aaaabbbaabbbbccccccccaacccccc"
>  "cbccccbccccbcccccbbbaaaaabaaa"
>  -- snip --

Isn't this what putmsg() and getmsg() are for?

Out of curiosity - Is this related to the record oriented pipes you
mentioned in the ksh93 review thread?

Chris
-- 
    ^---^
   (@)v(@)  Chris Pickett
   |    /   IT consultant
 ===m==m=== pkchris at users.sourceforge.net

Reply via email to