I have a Linux kernel module which creates a file in /proc
directory. My module has read function and write functions which are called when the file is read or written. It has a circular buffer to save data which has many buffer entrys.
When the file is written, the module will write data in circular buffer which is then read when the /proc
file is read.
When there are 2 threads, one thread may be writing into a buffer entry at the same time a read thread is reading from that buffer entry.
Will there be conflicts? How can i solve conflict between read thread and write thread?