-
Notifications
You must be signed in to change notification settings - Fork 847
TSContSchedule API renaming #6602
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
Conversation
870cffb to
b4d893e
Compare
| Pool Properties | ||
| =========================== ======================================================================================= | ||
| ``TS_THREAD_POOL_NET`` Transaction processing threads. Continuations on these threads must not block. | ||
| ``TS_THREAD_POOL_TASK`` Background threads. Continuations can perform blocking operations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NO_BLOCK and BLOCK as aliases or instead of NET and TASK?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not a bad idea, @SolidWallOfCode what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit too radical of a change, given all the documentation and code that uses those terms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding aliases would not require changing any of that.
| required to have a mutex, which is provided to :func:`TSContCreate`. | ||
| Schedules :arg:`contp` to run :arg:`every` milliseconds, on a random thread that belongs to | ||
| :arg:`tp`. The :arg:`every` is an approximation, meaning it will be at least :arg:`every` | ||
| milliseconds but possibly more. Resolutions finer than roughly 5 milliseconds will not be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm is the effective resolution really that consistent across different flavors of Linux, and FreeBSD and macOS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd assume so since this is in the docs way back before I ever touched anything.
Not exactly. It will schedule on a thread that matches the type, so the person scheduling must provide a type. If the type is the same as the current thread it's on, then it'll schedule on the current thread if there is no thread affinity set. |
|
There is an API function to schedule on a specific thread (which I think @keesspoelstra asked for at one summit, and lead to all of this...). Therefore, if what you want it so schedule on the current thread, you can easily do that. |
|
I'm impressed by the amount of documentation. Nice job! |
bryancall
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should rename TSContScheduleOnPool() to be TSContSchedule(). The function requires a pool and it makes more sense to have the name TSContScheduleOnPool(). I have mix feeling on getting rid of TSContSchedule()
|
I'm fine with either, I'll revert back to not changing the names then? |
Yeah, I tend to agree with Bryan - the naming of TSContScheduleOnPool() and TSContschedule() are more readable and intuitive to relate to the intended behavior. Even though TSContScheduleOnPool() can indirectly achieve the effect of scheduling on the current thread, it feels a bit too contrived and perhaps a bit needlessly complicated that it requires the user to explicitly pass a thread type, and it’d only pick the current thread when the affinity is not set. As a API user, one would much rather have a simple and direct API that says TSContSchedule() that defaults to the current thread without needing to worry about thread types. This is actually why I didn’t like reusing TSContScheduleOnPool() naming if we wanted to kill one of the API. I wish we had the option of using default parameters, with which we probably could have condensed into one API much more intuitively. Short of that, I dont particularly think having two separate (clearly named) API in this case is confusing or overload. Rather, repurposing one API to support too many combinations seems the more confusing option. Long story short, while I’m not -1 to condense into a single API and would be okay if everyone else feels that’s the right way to go, I’m definitely +1 on leaving the (2 separate) API as they are in ATS9 (current master). |
|
Given what I suggested a month ago I am glad to see @sudheerv and @bryancall have come around to my point of view. We should have Which I find much clearer than just |
b4d893e to
85c0725
Compare
85c0725 to
e00265b
Compare
|
Everything should be fixed by now. |
|
Reverted from the 9.1.x branch, and restored to Milestone 10.0.0 for now. |
As mentioned in #6577, we're now removing
TSContSchedule,then renaming. Also updated the docs and tests to reflect the change.TSContScheduleOnPooltoTSContSchedule