Skip to content

Add Semaphore #1101

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

Merged
merged 3 commits into from
Jun 6, 2019
Merged

Add Semaphore #1101

merged 3 commits into from
Jun 6, 2019

Conversation

ndkoval
Copy link
Member

@ndkoval ndkoval commented Apr 15, 2019

An efficient semaphore implementation.

Fixes #1088

@ndkoval ndkoval requested a review from elizarov April 15, 2019 21:44
@fvasco
Copy link
Contributor

fvasco commented Apr 16, 2019

Some cancellation tests can be added:

  • A simple test to ensure that cancellation releases the semaphore
  • A test to ensure that cancellation does not release semaphore before that inner block was completed (in case of blocking code/long task)

@qwwdfsad qwwdfsad force-pushed the develop branch 4 times, most recently from 1837412 to 1748ce1 Compare April 18, 2019 11:49
@ndkoval ndkoval changed the title [DO NOT MERGE] Add Semaphore Add Semaphore Apr 24, 2019
@ndkoval ndkoval marked this pull request as ready for review April 24, 2019 17:31
@ndkoval
Copy link
Member Author

ndkoval commented Apr 30, 2019

Arrays in atomicfu do not work, see Kotlin/kotlinx-atomicfu#65

ndkoval and others added 3 commits June 6, 2019 20:37
In addition, the `SegmentQueue` data structure, which emulates an infinite array with fast removing from the middle, is introduced for storing suspended acquirers in semaphore/mutex/channel algorithms.

Fixes #1088
@elizarov elizarov merged commit 3216825 into develop Jun 6, 2019
@elizarov elizarov deleted the semaphore branch June 6, 2019 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants