Groups | Search | Server Info | Login | Register


Groups > comp.lang.tcl > #55710

Re: Fastest way to run two external processes

From Ralf Fassel <ralfixx@gmx.de>
Newsgroups comp.lang.tcl
Subject Re: Fastest way to run two external processes
Date 2026-05-12 16:58 +0200
Organization A noiseless patient Spider
Message-ID <yga1pfgfzdc.fsf@akutech.de> (permalink)
References (4 earlier) <10t1j98$17vgs$1@dont-email.me> <ygazf2ikfz5.fsf@akutech.de> <10t4782$1vn4c$1@dont-email.me> <10tn2hc$3in5p$1@dont-email.me> <10tup1t$1qc1g$1@dont-email.me>

Show all headers | View raw


* Mark Summerfield <m.n.summerfield@gmail.com>
| > https://wiki.tcl-lang.org/page/promise
| > https://tcl-promise.magicsplat.com/
| > https://www.magicsplat.com/blog/tags/promises/
>
| I tried it but hit a problem. Here's the code I used:
>
| proc promised {pdf1 pdf2} {
|     set p1 [promise::pexec $::PDFTOTEXT $::OPT $pdf1 - 2>@1]
|     set p2 [promise::pexec $::PDFTOTEXT $::OPT $pdf2 - 2>@1]
|     set waiter [promise::all [list $p1 $p2]]
|     # Assumes eventloop not running!
|     promise::eventloop $waiter
|     set tsv1 [$p1 getdata]
|     set tsv2 [$p2 getdata]

promise::eventloop already returns the result of the 'waiter' promise
(i.e. those registered in promise::all).

So change those two 'getdata' calls to

   lassign [promise::eventloop $waiter] tsv1 tsv2
   
|     puts " tsv1=[string length $tsv1] tsv2=[string length $tsv2]"

HTH
R'

Back to comp.lang.tcl | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Fastest way to run two external processes Mark Summerfield <m.n.summerfield@gmail.com> - 2026-04-29 07:38 +0000
  Re: Fastest way to run two external processes Mark Summerfield <m.n.summerfield@gmail.com> - 2026-04-29 08:51 +0000
    Re: Fastest way to run two external processes meshparts <alexandru.dadalau@meshparts.de> - 2026-04-29 11:24 +0200
      Re: Fastest way to run two external processes Mark Summerfield <m.n.summerfield@gmail.com> - 2026-04-29 09:46 +0000
    Re: Fastest way to run two external processes Ralf Fassel <ralfixx@gmx.de> - 2026-04-29 12:30 +0200
      Re: Fastest way to run two external processes abu <user13892@newsgrouper.org.invalid> - 2026-04-30 00:51 +0000
        Re: Fastest way to run two external processes Ralf Fassel <ralfixx@gmx.de> - 2026-04-30 14:23 +0200
        Re: Fastest way to run two external processes Mark Summerfield <m.n.summerfield@gmail.com> - 2026-05-01 07:04 +0000
          Re: Fastest way to run two external processes Ralf Fassel <ralfixx@gmx.de> - 2026-05-01 22:54 +0200
            Re: Fastest way to run two external processes Mark Summerfield <m.n.summerfield@gmail.com> - 2026-05-02 06:57 +0000
              Re: Fastest way to run two external processes Ashok <apnmbx-public@yahoo.com> - 2026-05-09 16:03 +0530
                Re: Fastest way to run two external processes Ralf Fassel <ralfixx@gmx.de> - 2026-05-11 11:08 +0200
                Re: Fastest way to run two external processes Mark Summerfield <m.n.summerfield@gmail.com> - 2026-05-12 08:40 +0000
                Re: Fastest way to run two external processes Ralf Fassel <ralfixx@gmx.de> - 2026-05-12 16:58 +0200
                Re: Fastest way to run two external processes Mark Summerfield <m.n.summerfield@gmail.com> - 2026-05-13 08:54 +0000
  Re: Fastest way to run two external processes Olivier <user1108@newsgrouper.org.invalid> - 2026-05-01 10:06 +0000
  Re: Fastest way to run two external processes Emiliano <emiliano@example.invalid> - 2026-05-02 00:34 -0300

csiph-web