Skip to content

Add parallelisation to kaem#49

Open
fosslinux wants to merge 1 commit intooriansj:masterfrom
fosslinux:parallel-kaem
Open

Add parallelisation to kaem#49
fosslinux wants to merge 1 commit intooriansj:masterfrom
fosslinux:parallel-kaem

Conversation

@fosslinux
Copy link
Copy Markdown
Collaborator

Enabled by the _begin_parallel and _end_parallel commands. For example,

_begin_parallel 4
cc a.c
cc b.c
[...]
_end_parallel

will execute up to 4 of the cc commands in parallel at a time.

Note that this is lazy parallelisation; all commands are run at the _end_parallel command, in a non-deterministic order. As such, builtins are not permitted to be run in a _begin_parallel/_end_parallel block.

Enabled by the _begin_parallel and _end_parallel commands. For example,

```
_begin_parallel 4
cc a.c
cc b.c
[...]
_end_parallel
```

will execute up to 4 of the cc commands in parallel at a time.

Note that this is lazy parallelisation; all commands are run at the
_end_parallel command, in a non-deterministic order. As such, builtins
are not permitted to be run in a _begin_parallel/_end_parallel block.
@fosslinux fosslinux requested review from oriansj and stikonas March 21, 2025 04:37
@stikonas
Copy link
Copy Markdown
Collaborator

stikonas commented Mar 21, 2025

One annoying thing is that this breaks bash compatibility. We won't be able to run the same kame scripts with bash anymore...

I wonder if keyboard could somehow b #__begin_parallel. Not sure if this syntax would be confusing or not. Though it would certainly need changes in tokenizer (to avoid stripping this special comment).

@stikonas
Copy link
Copy Markdown
Collaborator

@oriansj also mentioned on IRC "but I worry about nondeterministic behavior in kaem"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants