Going forward with NTS

Achim Gratz Stromeko at nexgo.de
Tue Feb 5 20:29:39 UTC 2019


Hal Murray via devel writes:
> One thing that would be very nice is for msyslog to be thread safe.
>
> If we use a lock, we need to be able to recover in case we crash within 
> msyslog while the lock is held.
>
> I'm not enough of a Unix file system wizard.  Are there any guarantees about 
> multi-threaded writes to the same file not getting scrambled?  Will it work if 
> we buffer everything into a big buffer and do a single write?

POSIX and UNIX specifications probably don't make such a guarantee (that
I would rely on).

Linux does, as long as the file is on a local file system, opened for
append and you do the write in a single system call.  I think there's no
size limit for the buffer on Linux (although there's an informal limit
of (INT_MAX & ~PAGE_SIZE) that supposedly accounts for possibly buggy
VFS drivers), it always executes a system call atomically (it does
provide a kernel mutex for this).


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf rackAttack:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds



More information about the devel mailing list