Closed ammarbinfaisal closed 1 year ago
this always runs into a deadlock with the current approach.
// samples/chan.sahl
fun sendvals(c: chan<int>, count: int) {
let i = 0
while i < count {
c <- i
i = i + 1
}
}
fun recvvals(c: chan<int>, count: int) {
let i = 0
while i < count {
print(<-c, "\n")
i = i + 1
}
}
fun main() {
let i = 0
while i < 100 {
let a = make(chan<int>)
sahl sendvals(a, 10000)
sahl recvvals(a, 10000)
i = i + 1
}
}
closing this
actual go like instead of pthreads