Skip to content

dispatch: use auto-reset event for dispatch queue #542

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 1 commit into from
May 27, 2020

Conversation

compnerd
Copy link
Member

Use an auto-reset event for the dispatch queue on Windows. On Linux,
eventfd is used, which is auto-reset unless EFD_SEMAPHORE is
specified. This mirrors that behaviour. The test suite continues to
pass after this change.

Use an auto-reset event for the dispatch queue on Windows.  On Linux,
`eventfd` is used, which is auto-reset unless `EFD_SEMAPHORE` is
specified.  This mirrors that behaviour.  The test suite continues to
pass after this change.
@compnerd
Copy link
Member Author

@swift-ci please test

@compnerd
Copy link
Member Author

CC: @adierking

@adierking
Copy link
Contributor

LGTM - CF on Windows only does MsgWaitForMultipleObjectsEx(), so the event won't get reset otherwise. Good find!

@compnerd
Copy link
Member Author

@compnerd
Copy link
Member Author

@swift-ci please test

@compnerd
Copy link
Member Author

Hmm, I think that this is a problem in the CI:

Traceback (most recent call last):
  File "/home/buildnode/jenkins/workspace/swift-corelibs-libdispatch-PR-Linux/swift/utils/backtrace-check", line 110, in <module>
    main()
  File "/home/buildnode/jenkins/workspace/swift-corelibs-libdispatch-PR-Linux/swift/utils/backtrace-check", line 75, in main
    line = line.rstrip('\n')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xcf in position 536: ordinal not in range(128)

Seems like a python version/encoding issue
CC: @shahmishal

@compnerd
Copy link
Member Author

@swift-ci please test

lxbndr added a commit to readdle/swift-corelibs-foundation that referenced this pull request May 27, 2020
This ensures CFRunLoop correctly serves main dispatch queue.

Due to event specifics on Windows there was possibility to break
RunLoop making it think that main queue always has pending
work. The issue is adressed in swiftlang/swift-corelibs-libdispatch#542.
@compnerd
Copy link
Member Author

@swift-ci please test

@compnerd compnerd merged commit 598ce42 into swiftlang:master May 27, 2020
@compnerd compnerd deleted the auto-reset branch May 27, 2020 19:05
rokhinip pushed a commit that referenced this pull request Nov 5, 2021
dispatch: use auto-reset event for dispatch queue
Signed-off-by: Rokhini Prabhu <rokhinip@apple.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants