I have noticed the same problem. With fcntl locks, the lock isn't associated with a file descriptor, it's associated with the file, so if someone opens the file, checks the lock and closes the file in the same process, the lock is released.

Since it's a required lock, perhaps Solaris mandatory locking would be a better way to deal with the problem than a dict?


http://sunsite.uakom.sk/sunworldonline/swol-04-1998/swol-04-insidesolaris.html


Christian Theil Have wrote:
Hi

The file locking code for SunOS in CVS is not working properly. It will lock the files for other processes, but when accessed from the same process (the mms queue process) the lock will be ignored. This can cause some problems, since the messages are produced to multiple deliver deliver threads, which each attempts to deliver the message :-(

I am contemplating writing a fix for this, but I am not sure how to best go around this: I have tried implementing it using share reservations, which seems to work for different threads of the same process, but since the queue runs in the same process _and_ thread, share reservations doesn't really work out either.

I think a dict or similar could easily be used to keep track of the open files in the queue, but not so sure if this is the best solution. It might be satisfactory though.

What do you think?

Best regards,
Christian Theil Have
------------------------------------------------------------------------

_______________________________________________
Devel mailing list
Devel@mbuni.org
http://lists.mbuni.org/mailman/listinfo/devel

_______________________________________________
Devel mailing list
Devel@mbuni.org
http://lists.mbuni.org/mailman/listinfo/devel

Reply via email to