Atomic SerialPort.Write


SerialPort _port = new SerialPort("COM1");
_port.Write(new byte[] { 0x5 }, 0, 1);

Is the call to _port.Write Atomic?

@ Mr. John Smith - In the sample shown, you instantiate the serial port and then use it. No other thread has access to it. Why the atomic concern?

If I had multiple threads writing to a serial port, I would use a lock on the port, before writing, to it to insure there was not an issue.

(It’s answers like that, which rub me the wrong way)

@ Mike - If an RLP interrupt ocours, will the system switch from executing the Serial Write Command to processing the RLP interrupt?

???

Serial read and write run through internal buffers that use interrupts. Anything else can safely interrupt the transfer.

So and RLP interrupt occurring will interrupt the transfer. Can NETMF interrupts interfere with the transfer? Since I can’t use CAN bus anymore I’m planning to use Reed-Solomon to keep errors out and to avoid re transmission.

EDIT: (or some other non-binary cyclic error-correcting code)