orc-lang / orc

Orc programming language implementation
https://orc.csres.utexas.edu/
BSD 3-Clause "New" or "Revised" License
42 stars 3 forks source link

ensure consistent threading policy for site calls #16

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The current state of affairs (as of r958 is this):
1. Orc events and "site" sites run in the Orc engine thread.
2. Kilim methods run in the Kilim scheduler thread.
3. All "class" site calls, including constructors, static, and instance
methods, run in one of the site threads.
4. Orc and Kilim sites can request use of the site threads using
Kilim.runThreaded(...).

There are several issues with this:
1. it's not documented consistently. If we stick with this policy, we
should fix the documentation and get rid of ThreadedObjectProxy and other
unnecessary cases of explicit threading.
2. it's often very efficient. Short method calls which could be safely
executed in place have to go through a bunch of steps:
   - enqueue in the Kilim scheduler
   - execute in the Kilim scheduler and request a site thread
   - possibly block until a site thread becomes available
   - begin executing in the site thread
   - possibly block until the engine can accept a return value
   - wait for the return value to be processed in the queue
  Only the last two are necessary for "site" sites which execute in the Orc
engine thread. This is on top of the already high overhead of reflection
for calling Java methods.

We should benchmark to determine how inefficient this approach is, and
discuss whether the loss in efficiency is worth the safety of always making
progress in the engine without the user having to indicate which Java
methods might block.

Original issue reported on code.google.com by adrianqu...@gmail.com on 18 Apr 2009 at 2:41

GoogleCodeExporter commented 9 years ago

Original comment by adrianqu...@gmail.com on 18 Apr 2009 at 2:42

GoogleCodeExporter commented 9 years ago

Original comment by adrianqu...@gmail.com on 18 Apr 2009 at 3:44

GoogleCodeExporter commented 9 years ago

Original comment by adrianqu...@gmail.com on 18 Apr 2009 at 3:50

GoogleCodeExporter commented 9 years ago

Original comment by dkitc...@gmail.com on 19 Feb 2010 at 5:09

GoogleCodeExporter commented 9 years ago
Kilim has been removed as part of the OrcScala reengineering

Original comment by jthywissen on 9 Aug 2010 at 10:40