Gordon Henriksen <[EMAIL PROTECTED]> wrote:
> On Saturday, January 17, 2004, at 12:47 , Leopold Toetsch wrote:
>> Ops that can leave the code segment have to explicitely check for=20
>> events.

> Then no need to patch invoke*.

Yep, that's true. I'm waiting for the ops-file hints, then that can be
cleaned up.

> If the target thread handles the event and unpatches the bytecode before=20=

> the source thread finishes patching?

Then we have kind of a race ;)
But AFAIK it doesn't harm (except it slows down the interpreter a bit)
If the target thread hits again a patched instruction it checks the
task_queue, finds it empty, patches again the opcode stream with the
original code and continues running until the next real event is
scheduled.

And the target thread could communicate with the event-handler thread
with and "volatile *patch_opcode_t". This hasn't to be exact (so no
locking), but would allow, that the event-thread stops patching.

But if events arrive faster, then the time needed for patching the
opcode stream twice, then there is a real problem :)

[ BTW does anyone have a spare dual-Opteron machine, I'd really like to
  test threads on a MP machine ]

> Gordon Henriksen

> --Apple-Mail-7--579835501--

Can you switch that to send ASCII mails?

leo

Reply via email to