There lurks a bug inside sync where after passing a message between two threads we do the following:
https://github.com/svenssonjoel/Sense-VM/blob/master/backend/src/RTS.c#L507
Now imagine the communication is of the kind:
foo =
... sync (send c msg)
...
main =
let _ = spawn foo in
... syncT t1 t2 (recv c)
The sender, using the logic from RTS, will send the message and immediately wake up the main thread. However, the main thread was scheduled to sleep up to time t1. This will be a problem.
The analogue of this problem exists here - https://github.com/svenssonjoel/Sense-VM/blob/master/backend/src/RTS.c#L558-L559
where the sender might be moved to the rdyQ prematurely. This needs to be fixed.
There lurks a bug inside sync where after passing a message between two threads we do the following:
https://github.com/svenssonjoel/Sense-VM/blob/master/backend/src/RTS.c#L507
Now imagine the communication is of the kind:
The sender, using the logic from RTS, will send the message and immediately wake up the main thread. However, the main thread was scheduled to sleep up to time
t1. This will be a problem.The analogue of this problem exists here - https://github.com/svenssonjoel/Sense-VM/blob/master/backend/src/RTS.c#L558-L559
where the sender might be moved to the
rdyQprematurely. This needs to be fixed.