-
Notifications
You must be signed in to change notification settings - Fork 534
improve specification Publisher 1.3 #445
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
improve specification Publisher 1.3 #445
Conversation
Thanks @davidmoten! What do you think about the idea that we should take this even further and add |
@viktorklang Okey doke, will build on this PR |
@davidmoten Awesome, thank you! |
@viktorklang how about this: For the glossary: Serial(ly) - In the context of a signal, signals (for example calls to methods on an object) are non-overlapping (non-concurrent). In the context of the JVM, calls to methods on an object are serial if and only if there is a happens-before relationship between those calls. As mentioned in #431 we also need to:
|
Thanks David! I think we can possibly delete the External Synchronization entry in the glossary if we lift bits of it into the Serial(ly) definition, perhaps something along the lines of this:
As for 2.7, instead of
perhaps we can reword it to be:
and for 1.3 instead of:
it could be reworded to be:
For the other readers: the intent of these changes is not to change anything semantically in the spec. @reactive-streams/contributors Wdyt? |
I'm not keen on this bit, everything that needs to be said is said with more precision with the happens-before statement. The 2.7 change looks good to me. The 1.3 change is already in the PR but I'll add the glossary link. Might be able to remove the use of term Thread Safe from the specs. 2.11 intent is only mention currently:
|
@davidmoten Since it is about a glossary entry, I think it is nice to have an explanation that mentions thread satefy. Although @reactive-streams/contributors Thoughts? |
@viktorklang Perhaps this:
|
That might be enough. I took the liberty to insert an extra comma for an in my opinion easier read:
|
To be pedantic, the happens-before characterization: "calls to methods on an object are serial if and only if there is a happens-before relationship between those calls." should add: "and they are not overlapping" |
@DougLea That's a great point, I always assume non-overlapping so it is good to spell it out! |
Thanks @DougLea, I am after precision. The JVM specification talks about happens-before relationships between actions rather than calls. I had assumed that a call (a synchronous method invocation) was equivalent to the action of the method so I'm not sure why to add the extra phrase "and they are not overlapping". Can you clarify? |
@davidmoten The phrase is just intended to validate your assumption, in case there is any doubt. |
@DougLea beaut, let's include it |
@davidmoten Let me know when this is ready for review! thank you ^^ |
@davidmoten Ping :) |
I've updated the PR with results from discussion and clarified things a bit further (I hope). One thing I wanted to be conscious of in the text was that happens-before helps us out in the single-threaded scenario too by precluding re-entrancy and mutual calls. For example:
That last statement may not apply generally if one methods calls another (so a call to method A also calls method B thus methods A and B overlap). I handle this by omitting the statement. |
@reactive-streams/contributors Any comments on this before I merge? |
Thanks @davidmoten! |
As discussed in #431.