Re: data written to file missed by reader



David Schwartz wrote:
Kaz Kylheku wrote:

Also, be sure that you don't have multiple threads or processes sharing
the same file descriptor. Every reader must use its own, separately
opened fd.

That's not true if one of two things is the case:

1) The file descriptor is protected by a mutex that is acquired before
a seek and released after the read/write, or

2) You only use operations with built-in seeks like pread/pwrite.

That's equivalent to making your own file descriptor abstraction, to
which the original comments then apply. :)

.



Relevant Pages

  • Re: Re: Re: Proposal: a revoke() system call
    ... A particularly typical situation is a reader ... doesn't wake them up. ... if you close a file descriptor that has blocked ... This leaves a small race window between fd is checked and readis executed. ...
    (freebsd-arch)
  • Re: Re: Proposal: a revoke() system call
    ... same file descriptor. ... A particularly typical situation is a reader ... doesn't wake them up. ...
    (freebsd-arch)
  • Re: Re: Proposal: a revoke() system call
    ... A particularly typical situation is a reader ... doesn't wake them up. ... if you close a file descriptor that has blocked ...
    (freebsd-arch)
  • Re: checking value of variable while blocking in a system call
    ... >>block in the call to open(waiting for a reader), ... >>when SIGINT or SIGTERM is recieved). ... a normal (blocking) call to open, nothing happens at all when the ... > selectcan be used with any file descriptor. ...
    (comp.unix.programmer)
  • Re: data written to file missed by reader
    ... Kaz Kylheku wrote: ... Every reader must use its own, ... The file descriptor is protected by a mutex that is acquired before ... You only use operations with built-in seeks like pread/pwrite. ...
    (comp.os.linux.development.system)