Created
June 20, 2024 13:46
-
-
Save fuxoft/52da8949edba4961c059c18014d90cc3 to your computer and use it in GitHub Desktop.
PicoLisp IPC counter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/picolisp /usr/lib/picolisp/lib.l | |
(setq Uniq | |
(pipe | |
(prog | |
(zero X) | |
(loop | |
(pr (list "unique counter" (inc 'X))) ) ) ) ) | |
(if (fork) | |
(for N 3 (wait 1000) (println "parent step #" N (in Uniq (rd)))) | |
(for N 4 (wait 700) (println "child step #" N (in Uniq (rd))))) | |
(bye) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment