static L websMadeByProgram_parallel(S progID) { // TODO: clean up file handle in case of error IterableIterator l = scanLog_iterator(progID, "webs-made.txt"); fS src = progID; final L> webs; int poolSize = numberOfCores(), queueSize = 20; NotifyingBlockingThreadPoolExecutor e = new(poolSize, queueSize, 15, TimeUnit.SECONDS); try { int i = 0; for (fS s : l) { ++i; final int _i = i; e.execute(r { pcall { SoftwareMadeWeb o = cast unstructure(s); Web web = o.web; if (web == null) web = (Web) unstructure(o.structure); if (web != null) synchronized(webs) { webs.add(pair(web_intern(web_setSourceIfEmpty(web, src)), _i)); } }}); } e.await(); } finally { e.shutdown(); } sortBySecondOfPairs_inPlace(webs); ret firstOfPairs(webs); }