• Announcing Tasks

    From ted brown@21:1/5 to All on Sat Nov 6 12:40:39 2021
    Tasks are a concurrent programming abstraction layered on Tcl Threads.

    Tasks present the meta-command [Tproc] which can be used in place of the command [proc] to transform and run a given procedure multiple times in parallel on a multi-core cpu.

    Tprocs are best used with functional style compute intensive procedures
    that can be easily factored into independent calls. The format of
    [Tproc] is the same as a [proc]:

    Tproc name {arg1 arg2 ...} {
    body returning a value
    }

    The procedure [name] is loaded into N threads where it is run M times concurrently on a group of arglists using the included [tgroup] command:

    tgroup name -run {arg1 arg2 ...} {arg1 arg2 ...} ... arglist-M

    This will also wait for all M to complete. The M results are placed in
    an array of the same name. If M > N additional arglists will be queued
    up and run by the N threads as they become ready to process more arglists.

    Tasks are a pure tcl, single code block to be [source]-d:

    https://wiki.tcl-lang.org/page/Tasks


    Have Fun.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)