Hi everybody, Let me elaborate on the e-mail I sent before. First, two test cases to prove the problem is not imaginary (boy, that would suck :-)). For this I've created a github repo:
https://github.com/bdw/multiple-interpreters.git With the latest push on my find-root-interpreter branch, child_interpreters runs until interpreter destruction, upon which it crashes. I don't really know why (although it happens in main_arena, but there seem to be no debugging symbols in that function on my local install). What bothers me a bit is that I don't really know how this should be done and dealt with. Kind regards, Bart Wiegmans > Date: Sun, 5 Aug 2012 11:27:12 +0200 > From: Bart Wiegmans <[email protected]> > To: [email protected] > Subject: Interpreter scheduler and Child interpreters > Message-ID: > <CADc7B-+L9zCKJMfVn1F=ikaankmzu3er3y6akzk4auvj-nm...@mail.gmail.com> > Content-Type: text/plain; charset=UTF-8 > > Hi everybody! > > Once again, working on mod_parrot, I noticed a bit of an issue with > parrot. But I can't really get to how to resolve it, so I'm asking > your advice. > > The context: I want to run multiple interpreters in the same program, > at the same time, running different programs. This is a requirement > because otherwise, mod_parrot can only run in the prefork apache mpm, > which uses a relatively large amount of memory and other resources and > for this reason is not very popular with web hosters. Thus, without > running in a multi-threaded enviroment, mod_parrot is nearly useless. > > This is not as simple as it seems, because of the following: > * having two separate interpreters at the same time is apparantly not > very ok, unless they are parent and child (no idea why) > * but if a child is instantiated it does not get a scheduler of its > own (Parrot_cx_init_scheduler) > * which causes it to crash when starting execution because > interp->scheduler is 0x0 (literally everywhere in src/scheduler.c) > > Thus, I created a new function in src/interp/api.c, called > Parrot_interp_get_scheduler, and combed through the code to replace > direct access of the scheduler with this delegated access. However, > considering the amount of places that it was directly accessed, and > seeing the behavior of it, I'm actually doubting whether it is a good > idea. I in fact doubt whether having multiple interpreters is a good > idea at all given the current state of things. For this reason I'm not > placing a pull request right now, but I do ask you to review the > changes in the branch, please see > https://github.com/bdw/parrot/tree/find-root-scheduler . > > Kind regards, > Bart Wiegmans > > > ------------------------------ > > _______________________________________________ > http://lists.parrot.org/mailman/listinfo/parrot-dev > > > End of parrot-dev Digest, Vol 48, Issue 6 > ***************************************** _______________________________________________ http://lists.parrot.org/mailman/listinfo/parrot-dev
