Re: porting status
Joakim Johansson <
jocke@...>
2011-04-12 16:27:28 GMT
Hi Jordan,
Some thoughts:
I think that is a good question - although it has been very convenient during the bring-up phase to have it in
an external repository, it seems to me that it would be a better solution to integrate at least
libpthread_workqueue, as you suggest. Libkqueue seems usable on its own merits, which suggests that it
should remain stand-alone.
libpthread_workqueue is a fairly limited codebase and even though some refactoring/packaging may be
required, it shouldn’t be too much work to integrate it nicely.
Even though I do think it should be considered if it would be beneficial to use some other abstraction
instead of the pthread_workqueue interface for the non-Mac OS X parts, it is not obviously required at
present - the current approach seems to work quite well so far.
If there would be a clear benefit, at least it is only in ~10 places that libdispatch references the
pthread_workqueue API:s, so any such hypothetical #ifdefs would at least be limited in scope.
Another aspect of this though, would be if one wants to bring libpthread_workqueue further in terms of
‘cooperation’ between multiple clients of the library (as discussed between you and Mark a long time
ago).
Personally I think that would be desired an beneficial, even taking the DOS problems brought up then into
consideration, at least as an optional input to the thread scale rampup/down logic.
For reference: currently libphtread_workqueue takes into account several inputs for deciding when to
gracefully ramp up/down the number of threads used (e.g. number of available cores, current system load
average, the number of currently runnable threads/LWP:s in the process, how long (and how many) threads
that are idle, ...) - but it is only working really well within the scope of a single process, since the
(Continue reading)