Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Named semaphores are not fair. #1

Open
Micrified opened this issue Aug 17, 2018 · 0 comments
Open

Named semaphores are not fair. #1

Micrified opened this issue Aug 17, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@Micrified
Copy link
Owner

A process blocked on a semaphore is currently unblocked if it is the first process found in the process table that is blocked on that semaphore. The preference is ordered by:

  1. Processes belonging to arbiters with a lower socket number.
  2. Processes at the front of the arbiter's process list (a linked-list).

The implications of this scheme means that the system is biased towards processes that happen to be registered last in arbiters that connected earliest. To implement semaphores fairly, the process that blocked first should be the first to be unblocked if the semaphore is "upped".

@Micrified Micrified added the enhancement New feature or request label Oct 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant