Skip to content
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

Give user some control over scheduling in tpool_submit() #4

Open
patrickmacarthur opened this issue Dec 28, 2011 · 0 comments
Open
Milestone

Comments

@patrickmacarthur
Copy link
Owner

I envision the following three scenarios:

  1. default case: This is the way that it is right now. A new thread would be spawned for the task if there are more threads available; otherwise, the task would be queued.
  2. queued mode (e.g., task->flags & TPOOL_TASK_QUEUED): The task would be always queued unless there are no threads currently running in the pool, in which case a thread would be spawned for the task.
  3. immediate exclusive mode (e.g., task->flags & TPOOL_TASK_IMMEDIATE): A new thread would be spawned for the task if there are more threads available; otherwise, tpool_submit() would return EBUSY.

Flag names aren't set in stone yet. If the two constants that I used above are used, then TPOOL_TASK_QUEUED and TPOOL_TASK_IMMEDIATE will be mutually exclusive (if used together, tpool_submit would return EINVAL).

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

No branches or pull requests

1 participant