Re: Proper way to provide gtk+ app with asynchronous data?



John Cupitt wrote:

Very simple and easy to program. I'm assuming writing 4 bytes to a
pipe is atomic, I guess. I've not had problems (even on SMP machines),
but it would be easy to add a global mutex for the pipe writers.


Oh, by the way. On a POSIX conformant system, a write to a pipe _is_ guaranteed to be atomic as long as it's no larger than PIPE_BUF (from limits.h) bytes. So 4 bytes should be safe.

--
Christer Palm



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]