[Vm-dev] Re: [squeak-dev] re: "callback failed to own the VM"
Eliot Miranda
eliot.miranda at gmail.com
Fri Oct 9 16:48:17 UTC 2015
Hi Craig,
On Fri, Oct 9, 2015 at 3:36 AM, Craig Latta <craig at netjam.org> wrote:
>
> > a) write a scratch primitive called e.g. primitiveFakeAForeignCallback
> > which forks (at a higher priority?, or at least does a yield?), and
> > calls the relevant machinery with faked up callback data (so you can
> > avoid all the stuff in thinkProcess which is written in C)
>
> Which machinery is that? callbackEnter:? I have the simulator and
> reader image going.
>
here's the edited-down guts of thunkEntry, which is what you wasn't to
simulate:
long
thunkEntry(void *thunkp, long *stackp)
{
...
if ((flags = interpreterProxy->ownVM(0)) < 0) {
fprintf(stderr,"Warning; callback failed to own the VM\n");
return -1;
}
if (!(returnType = setjmp(vmcc.trampoline))) {
...
interpreterProxy->sendInvokeCallbackContext(&vmcc);
fprintf(stderr,"Warning; callback failed to invoke\n");
...
interpreterProxy->disownVM(flags);
return -1;
}
...
interpreterProxy->disownVM(flags);
switch (returnType) {
case retword: return vmcc.rvs.valword;
...
So I expect you want to do something like
[self ownVM: 0.
self sendInvokeCallbackContext: fakeVMCallbackContextAddress] forkAt:
Processor activePriority + 1
You could even create a CArray or some such to hold onto the data for the
callback (fakeVMCallbackContextAddress above).
>
> > BTW, this is /monstrously/ cool of you!
>
> Sure thing!
>
>
> -C
>
> --
> Craig Latta
> netjam.org
> +31 6 2757 7177 (SMS ok)
> + 1 415 287 3547 (no SMS)
>
>
>
--
_,,,^..^,,,_
best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20151009/27d55c6a/attachment.htm
More information about the Vm-dev
mailing list