Multithreading

18 views
Skip to first unread message

luserdroog

unread,
Jul 26, 2014, 3:53:38 AM7/26/14
to xpost-...@googlegroups.com
I've stitched-up a partly working fork operator as of revision http://code.google.com/p/xpost/source/detail?r=be625c0d2d18d05264dbc36d69d579c20e01d1f8 .
 
PS>mark { (hello world!\n) print yield } fork (hello back!\n) print yield
hello world!
hello back!
bye!
 
The child has no "cushion" on its exec stack, so it falls off the bottom and the interpreter quits (its failsafe action). This should be changed so the context becomes a zombie and then I can write -join- to search for them.
 
baby steps.

luserdroog

unread,
Jul 27, 2014, 1:25:49 AM7/27/14
to xpost-...@googlegroups.com
Ok. I've got the basic dps context operators appearing to work acceptably.
 
mark obj0..objn proc  fork  context
context  join  mark obj0..objn
-  yield  -
context  detach  -
 
I still need to learn how to mutex data structures work. :(
 
   -  lock  lock
   create lock object
 
   lock proc  monitor  -
   execute proc while holding lock
 
   -  condition  condition
   create condition object
 
   lock condition  wait  -
   release lock, wait for condition, reacquire lock
 
   condition  notify  -
   resume contexts waiting for condition
 
Reply all
Reply to author
Forward
0 new messages