What is the relationship between writableStream.highwatermark in nodejs and PIPE_BUF in POSIX specification

49 views
Skip to first unread message

WooD Fung

unread,
Jun 6, 2014, 10:21:59 PM6/6/14
to nod...@googlegroups.com

According to POSIX specification, if you write less than the size of PIPE_BUF, this operation shall be atomic.

The default writableStream.highwatermark in nodejs is 16 kilobyte. writableStream.write will return false when the total size of the being flushed data is greater this value.

Let say the PIPE_BUF of my OS is 512 byte which is much smaller than writableStream.highWatermark. Does it mean the write operation of nodejs must not be atomic?

Conrad Pankoff

unread,
Jun 7, 2014, 11:51:56 PM6/7/14
to nod...@googlegroups.com
They're completely unrelated. You're correct also in your assumption that writes are not (guaranteed to be) atomic.

WooD Fung

unread,
Jun 8, 2014, 6:16:09 AM6/8/14
to nod...@googlegroups.com
if i set the highwatermark to 0 and each write is less PIPE_BUFF, can i say that it must be atomic
Reply all
Reply to author
Forward
0 new messages