Not logged in
Log in now
Create an account
Subscribe to LWN
LWN.net Weekly Edition for December 5, 2013
Deadline scheduling: coming soon?
LWN.net Weekly Edition for November 27, 2013
ACPI for ARM?
LWN.net Weekly Edition for November 21, 2013
This sounds very much like how goroutines were described, which is interesting.
Some approaches to parallelism avoidance
Posted Dec 2, 2009 18:58 UTC (Wed) by HIGHGuY (subscriber, #62277)
One way to solve would be to overallocate threads, but that only brings unnecessary context switching. Another would be to require the user to use async I/O but this tends to be rather complex and impacts the threadpool user's code instead of the library itself.
The prototype implementation, as I saw later on, actually resembles what Tejun Heo is doing with his workqueue implementation. When one thread of the workqueue blocks, another one is woken to resume work. The big difference, of course, being that workqueues are kernel-only, while userspace might definitely benefit from a similar approach.
At this moment I'm geared towards implementing Ingo's solution as that would not only benefit my use-case, but could also be used as a true perf-counter to measure how well a given workload is using the available CPU-power. It's also quite flexible.
Linus' solution could still be added later on as both solutions have no impact on each other as far as I can tell.
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds