site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com User-agent: Icedove 1.5.0.9 (X11/20061220) Michael,
The problem here is that you are conflating "thread" with "work".
Ideally you would parcel your work out in well-ordered units, and schedule those units to threads in such a fashion that progress happens with the desired balance.
That is great in an ideal world where you write the code that the threads execute. But we don't live in an ideal world: in my case each thread is like a black box: I control the initial input to these threads, but then they go do their heavy computation, and just report progress. What they do precisely to perform their computation is unknown to me. All I know is that if I make them progress at the same rate, whatever they compute will be computed faster overall (and more accurately).
We are wondering which API can be used to do that. Would an IOSleep(0) (which is the way you do it on Windows) work or will it just be ignored?
You don't want to do this, on either platform. You have no control over what "slow it down" actually means, and you aren't communicating what you really want to the scheduler.
I have perfect control on Windows where Sleep(0) is documented to do exactly what I want. I have perfect control on Linux where cond_resched() is documented to do exactly what I want. I'm trying to have perfect control on Mac OS by finding an API that is documented to do exactly what I want :) Thanks, -- hpreg _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com