-
Notifications
You must be signed in to change notification settings - Fork 240
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
[ElmSharp] Question about EcoreSynchronizationContext.Post() #694
Comments
Yes, you're right. Fortunately, EcoreSynchronizationContext is not used in normal case. If you need a Anyway, I'll fix it Thanks your reports |
Hello, Your change fixes the reported problem, however it introduces another one. Basically, the documentation doesn't mention anything about call order, but some applications expect that:
will result that action1 will be called before action2. That's not true for Post method (and PostAndWakeUp called on the main thread). Please check following snippet:
When called on the main thread, it prints:
When called on a non-main thread, it prints:
Example when such behavior causes a problem can be found here: |
As you mentioned, |
Hello,
I have a question regarding the EcoreSynchronizationContext.Post() method. According to the documentation, this method should dispatch an asynchronous message to a main loop, see:
I would expect that my message will be added to the end of a main loop queue and called when all pending messages are processed. This would be consistent with other SynchronizationContext implementations, like: TizenSynchronizationContext or Nito.AsyncEx.AsyncContext.AsyncContextSynchronizationContext. However, EcoreSynchronizationContext behaves differently - a message is called synchronously if it is dispatched on a main loop thread, see:
Such behavior may cause reentrancy issues and it seems to be inconsistent with the documentation. Is it intentional?
The text was updated successfully, but these errors were encountered: