Dan Sugalski <[EMAIL PROTECTED]> wrote:
> At 4:30 PM +0100 12/17/03, Leopold Toetsch wrote:
>>     getinterp P2
>>     find_method P0, P2, "thread"
>>     find_global P6, "_foo"
>>     clone P5, P2
>>     invoke   # start the thread

> I think I'd like to start new threads a bit differently, at least
> much more explicitly than an invoke. Invoke on an interpreter
> arguably ought to dispatch to the interpreter *without* starting a
> new thread.

Its not invoking the interpreter, the "thread" method of a ParrotThread
is invoked. Actually the example is a bit outdated - the clone is gone
and a new .ParrotThread is instantiated. it should read now or finally:

   new P2, .ParrotThread
   set S0, "thread"     # or better "start" or "run"
   find_global P5, "_foo"
   set P6,  arg1
   callmethcc

It should be the same calling sequence as doing a method call on a new
ParrotThread or any other object. But P2/P5 object passing did interfer.

> We also need to work out the details of what and how we clone and
> create new interpreters, what gets copied and what doesn't. I see
> that thread's already started, though. :)

Yep. Currently its the register file to get things running, nothing
more.
"Subject: threads and shared interpreter data structures"
has an example of one of the problems I encountered til now.

leo

Reply via email to