Richard Oudkerk added the comment: > I think you got that argument backwards. The simple greedy policy you > implement works well provided there are not too many readers. Otherwise, > the writers will be starved, since they have to wait for an oppertune > moment when no readers are active to get a foot in the door, so to speak.
Actually, I think Sebastian's algorithm attempts to be fair to both readers and writers. If there is a writer waiting then "self._wait_count > self._granted_count". The writer cannot be prempted by a later reader because the reader would find "waitno > self._granted_count" until after writer has been granted the lock. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue8800> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com