Changes between Version 17 and Version 18 of library_mwmr
- Timestamp:
- Oct 30, 2015, 10:19:53 AM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
library_mwmr
v17 v18 27 27 28 28 The '''nb_mwmr_read()''' and '''nb_mwmr_write()''' non blocking functions can be used to implement various higher level communication protocols. 29 30 Besides the MWMR channels, the MWMR library provide another - optional - service: The '''mwmr_bufio_t''' buffer (and the associated access functions) can be used to implement a private input or output buffer, and move data to or from a shared MWMR communication channel. This buffer can be declared as a local variable in the stack of the reader/writer thread, and simplifies the access to the MWMR channel when the transfered data have a non fixed format, and must be analysed or produced byte per byte: an input buffer is automatically refill when it becomes empty; an output buffer is automatically flushed when it becomes full31 29 32 30 … … 74 72 It takes the lock for exclusive access before testing the channel state. If there is not enough data in the channel, it transfer as many items as possible, releases the lock, and returns the number of actually transfered items (it can be 0). 75 73 74 75 Besides the MWMR channels, the MWMR library provide another - optional - service: The '''mwmr_bufio_t''' buffer (and the associated access functions) can be used to implement a private input or output buffer, and move data to or from a shared MWMR communication channel. This buffer can be declared as a local variable in the stack of the reader/writer thread, and simplifies the access to the MWMR channel when the transfered data have a non fixed format, and must be analysed or produced byte per byte: 76 * the buffer descriptor contains a byte pointer. 77 * an input buffer is automatically refill from the associated MWMR channel when it becomes empty. 78 * an output buffer is automatically transferred to the associated MWMR channel when it becomes full. 79 76 80 == __Private Buffer Initialization__ == 77 81 … … 111 115 === void '''mwmr_bufio_flush'''( mwmr_bufio_t* bufio ) === 112 116 This function transfer the current content of the <bufio> output buffer to the associated MWMR channel when it is non empty. 113