<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch master
in repository macports-base.
</pre>
<p><a href="https://github.com/macports/macports-base/commit/bdeaa8144d34a2f800e6fdb96c4649c8ebb7f020">https://github.com/macports/macports-base/commit/bdeaa8144d34a2f800e6fdb96c4649c8ebb7f020</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new bdeaa8144 portindex: start threads on demand
</span>bdeaa8144 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit bdeaa8144d34a2f800e6fdb96c4649c8ebb7f020
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Tue Jan 21 00:11:27 2025 +1100
<span style='display:block; white-space:pre;color:#404040;'> portindex: start threads on demand
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Start with 1 thread and allow tpool::post to start new ones (up to the
</span><span style='display:block; white-space:pre;color:#404040;'> maximum) if there are none idle. This should improve startup time when
</span><span style='display:block; white-space:pre;color:#404040;'> indexing a repo with less than $buildmakejobs ports in it.
</span>---
src/port/portindex.tcl | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/port/portindex.tcl b/src/port/portindex.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 2b15b992a..1ef950267 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/port/portindex.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/port/portindex.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -212,7 +212,7 @@ proc init_threads {} {
</span> [list set oldmtime $oldmtime] \n
}
set maxjobs [macports::get_parallel_jobs no]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set poolid [tpool::create -minworkers $maxjobs -maxworkers $maxjobs -initcmd $worker_init_script]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set poolid [tpool::create -minworkers 1 -maxworkers $maxjobs -initcmd $worker_init_script]
</span> set pending_jobs [dict create]
set nextjobnum 0
tsv::set mutexes PortIndex [thread::mutex create]
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -243,7 +243,7 @@ proc handle_completed_jobs {} {
</span> if {$subport eq "" && [tsv::exists subports $jobnum]} {
foreach nextsubport [tsv::get subports $jobnum] {
tsv::set status $nextjobnum 99
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set jobid [tpool::post -nowait $poolid [list pindex $portdir $nextjobnum $nextsubport]]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set jobid [tpool::post $poolid [list pindex $portdir $nextjobnum $nextsubport]]
</span> dict set pending_jobs $jobid [list $nextjobnum $portdir $nextsubport]
incr nextjobnum
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -284,7 +284,7 @@ proc pindex_queue {portdir} {
</span> # Start with worst status so we get it when the thread
# returns due to ctrl-c etc.
tsv::set status $nextjobnum 99
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set jobid [tpool::post -nowait $poolid [list pindex $portdir $nextjobnum {}]]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set jobid [tpool::post $poolid [list pindex $portdir $nextjobnum {}]]
</span> dict set pending_jobs $jobid [list $nextjobnum $portdir {}]
incr nextjobnum
}
</pre><pre style='margin:0'>
</pre>