From: Sebastian P. <seb...@pi...> - 2011-10-11 05:22:33
|
On 09/23/2011 08:11 AM, Merx, Thomas wrote: > Hi everybody, > > I am new to Fuse and have a question regarding parallel read and > write accesses to the same file. I want to write some kind of > "driver" in user space which provides nodes from which I can read > data if available and write some data to it. If no data is available > the read shall block. In this case I still want to be able to write > data to the same node. When I do this with Fuse and I am blocked > waiting for a semaphore in the read function, I am not able to write > any data to this node. I assume that there is only one thread for the > read and write functions, am I right? Is there another way to do what > I want? Just thinking aloud: To my understanding by default FUSE operates with multiple threads. There is an option -s disable multi-threaded operation to disable that but I expect poor performance from that. Unless you are using a mutex/semaphore/lock yourself, reads and writes should go in parallel if request come in like that. If you are using a semaphore maybe your locking logic needs to change? Best, Sebastian |