[1211] in Coldmud discussion meeting

root meeting help first first in chain previous in chain previous next last

Re: [COLD] Down n Dirty native methods

daemon@ATHENA.MIT.EDU (Wed Jan 15 04:07:24 1997 )

From: silovic@srce.hr (Miroslav Silovic)
In-Reply-To: <3.0.32.19970114200659.00683cf4@mail.tenetwork.com> from Jeff Kesselman at "Jan 14, 97 08:07:00 pm"
To: jeffk@ten.net (Jeff Kesselman)
Date: Wed, 15 Jan 1997 09:59:07 +0100 (MET)
Cc: coldstuff@cold.org

> Okies,
> I need to be able to create a method invocation from inside my native
> method.  I'm implementing the TEN security/billing interface and its based
> on callbacks from an idle function.  Trying to translate that to something
> else will cost me e\seriosu efficiency ADN a lot of unecc C coding.
> 
> What I need is a function like Perl5's perl_call().
> Does this exist? If nto, coudl someone write one fairly quickly??
> 
> Jeff K.
> 

Actually call_method() was already hacked to put the current task into
the background and call a new method as needed. But it crashes the
driver and wouldn't work with the callbacks that pause. To spell
it out: current virtual machine doesn't allow calling from C
to ColdC. And yes, this is major problem (we hope to deal with it
when we have multithreaded server, then we'll also rewrite multitasking).
For the temporary solution: check the #ifdeffed part in task() (or
call_method, I'm not sure), enable it, find out why it crashes, and
make sure that new task runs atomically (so that it actually returns).
Another way to do it is to use the trick from scatter assignment, where
one operator puts the necessary stuff on stack, returns to the interpreter,
and another operator picks up when the other left. Hope this helps (since
my current priority is debugging - we have stability problem).

	Miro