mattunlv / ProcessJ-main-branch-old

ProcessJ Compiler Project
2 stars 4 forks source link

Deadlock.. #9

Closed mattunlv closed 7 years ago

mattunlv commented 7 years ago

This will deadlock: import std.io;

proc void hello() { println("Hello"); }

proc void world() { println("World"); }

proc void main(string args[]) [yield=true] { par { hello(); world(); } println("Good bye"); }

if hello and world does not have [yield=true] … I don't know if this is my problem ;-)

cabelshrestha commented 7 years ago

I haven't tried it, but looks like that will deadlock as the main proc waits for the par items to decrement its count and set it ready...but hello and world procs do not have a terminate method to do so.

How do we want to handle this?

cabelshrestha commented 7 years ago

Fixed using 'anonymous' process wrap.