[plt-scheme] Calling virtual C++-functions from other MzScheme-threads

From: Daniel Kjøller Skovenborg (waldeinburg at yahoo.com)
Date: Sat Nov 22 10:37:07 EST 2003

> MzScheme threads are implemented by copying data
> into and outof the
> stack, so the "a" object isn't there when a second
> thread tries to use
> it.

Ah, and because 'pa' was previously allocated for an A
object then we can call A::foo if it's not virtual.
And if we let A::foo print the value of some
integer-member then it's some random value. I see.

So the data is popped when shifting threads? But the
'a' object is there again when switching back to the
thread running tfoo. Would it be harmful for MzScheme
if I access the copy it keeps of 'a' (the data that is
pushed on the stack when switching back to the

Or should I just make som changes to the design in my

Thanks for the information

Do you Yahoo!?
Free Pop-Up Blocker - Get it now

Posted on the users mailing list.