Here's a (very) rough proof of concept of a threaded equivalent of mportdepends. It's uncommented, some things have weird names, the thread management could be smarter, etc. But it shows that the approach is feasible and performs well enough to be worthwhile.

There's a lot missing compared to the real thing of course, like arch checking, but it does adjust which deps are needed based on whether an archive is available, which is actually where we spend a lot of time blocked. Threads hide the latency of the HTTP requests well.

While access to the Portfile interpreters is transparent across threads, some changes would be required to use them like this in base, as they can update some state that is global to their parent interpreter, like the ping cache. This would have to be changed to be thread shared.

- Josh

Attachment: thread_deps.tcl
Description: Tcl script

Reply via email to