Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

7 Commits

Repository files navigation

pthread

A naive bindings for pthread in Carp

Example

(load"git@github.com:TimDeve/pthread@v0.1.1")
(use-all Result Array)
(defnpush-rand-int [arr]
(push-back! arr (Int.random-between010000)))
(defnmain []
(let-do [mutex &(Mutex.new [])
callback &(fn [] (Mutex.access mutex &push-rand-int))]
(Random.seed)
(ignore
(Thread.join-all
(repeat1000 &(fn [] (unsafe-from-success (Thread.create callback))))))
(Mutex.access mutex &(fn [arr] (println* (str arr))))))

About

A naive bindings for pthread in Carp

Topics

Resources

Stars

8 stars

Watchers

2 watching

Forks

Releases

Contributors