[Stackless] multiprocessing module and stackless threads

Robert Babiak rbabiak at gmail.com
Fri Jan 3 02:04:48 CET 2014


Thanks Richard.

but what do you mean by "monkeypatch it via stacklesslib" how/ where can i
learn about MonkeyPatching?

Then I would assume I would just run it as any other tasklet, which I would
suspect would solve several problems i have with passing events, and SQL
calls on the wrong thread.

- Rob

---------- Forwarded message ----------
From: Richard Tew <richard.m.tew at gmail.com>
To: The Stackless Python Mailing List <stackless at stackless.com>
Cc:
Date: Thu, 2 Jan 2014 11:58:39 +1300
Subject: Re: [Stackless] multiprocessing module and stackless threads
If your web server uses non-blocking IO, then it shouldn't be
necessary to have two schedulers.  I imagine with Django, you would
monkeypatch it via stacklesslib and it would then work in a
stackless-compatible non-blocking fashion.

Stackless supports per-thread schedulers, and explicitly supports
interthread channel communication.  There is no explicit Stackless
support for multiprocessing.  If it opaquely uses threads, then it
works in the manner mentioning threads above.  If interthread channel
usage is not being used, then channels switch between tasklets on the
same Python thread.

Cheers,
Richard.

On 1/2/14, Robert Babiak <rbabiak at gmail.com> wrote:
> I have a question.
>
> Is it possible to use the multi processing module and stackless together?
>
> What i would like to do is have my application start a second process to
> handle the web server side of things, and the main thread control the main
> display.
>
> Can the two communicate via channels, or is the separate process
completely
> independant?
>
> If I don't use the multiprocessing and just use the threading module to
> make a dedicated web server thread. Would it be better to run two
stackless
> schedulers and have the one only run a single tasklet running the web
> server request loop?
>
> FYI: I am using DJANGO for the web server support, and the main display is
> a Open GL display. The main interaction to the display will be by web
> requests, but only some web calls will interact with the GL display.
>
> Suggestions and wisdom welcome.
>
> - robert
> --
> Life: Bah, I will worry about it when it is over.
>

-- 
Life: Bah, I will worry about it when it is over.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.stackless.com/pipermail/stackless/attachments/20140102/3cc898f2/attachment-0001.html>


More information about the Stackless mailing list