From: Paul A. <pal...@ea...> - 2004-02-18 01:24:09
|
On Tue, 2004-02-17 at 03:15, Miklos Szeredi wrote: > > In my project, all the processes are talking to one physical device (the > > 1-wire bus over a serial or USB connection), and then to multiple > > devices on that bus. It's easy to lock the bus for each message, but an > > entire transaction may take several messages, with pauses for processing > > by the peripheral device. Thus I need both bus locking, and periperal > > device locking. > > Yes. The important thing is to always do locking of these in the same > order, otherwise a deadlock could occur. But this case is pretty > obvious: the device lock should be the outer and the bus lock the > inner one. > For that kind of handling, I can just stay with the single-threaded approach. My issue is that I'd like to interweave device work. A more common analogy: Think IDE bus and two disks. Threads need to wait on threads to only the same disk. If the library passed on any thread information, a thread could see what the other threads are doing and block on threads to the same disk. Currently, this requires breaking into the FUSE library, probably by copying and altering it. I'd like to avoid changing libfuse, since it will be hard to follow changes there. So my hope is that you see some elegant way to export thread information from libfuse. Paul Alfille |