site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com User-agent: Mutt/1.5.9i Hi All, in a multi-threaded terminal application I use writev(2) to write status messages to stderr (for testing purposes an xterm), however although the complete message is written with a single call to writev (and now I also tested write, with the same effect), and in the tested case the length of the message was well below PIPE_BUF, the output of the different threads is sometimes interleaved (always starting at 40 bytes into a message, i.e. 40 bytes of the first message, and then another message, then the rest of the first message). I am pretty sure that all standards require at least write(2) to be async-signal-safe, and to write messages smaller than PIPE_BUF atomically ... does anyone know more about this on Darwin? (Including pointers to more documentation about thread safety of the kernel and libc functions; only very few like getaddrinfo(3) seem to have notes on this subject (and in that case stating only that it is _not_ thread safe, contrary to POSIX) in their man-page.) Thanks, Colin PS: 10.4.3 on a Mac mini. _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
share-darwin@think42.com