[Stackless] Question about stackless code.

Richard Tew richard.m.tew at gmail.com
Tue May 20 06:13:53 CEST 2014


Starting a tasklet from C:

https://code.google.com/p/stacklessexamples/source/browse/trunk/examples/embedding/

You can recreate something like the interpreter command line from
scratch, but at it's heart the interpreter command-line uses low level
C API which Stackless cannot make non-blocking so when it blocks for
input it will block your scheduler for that thread.

Kristjan made some recent changes to how tasklets and threads work
together.  It may be possible to create a tasklet for another thread,
and indeed I believe he has discussed this on the mailing list.

Also, there is some documentation but likely it needs expounding on
the current capabilities and limitations of schedulers and threads and
tasklets.

http://stackless.readthedocs.org/en/latest/stackless-python.html

Cheers,
Richard.

On 5/20/14, Robert Babiak <rbabiak at gmail.com> wrote:
>  I know this thread isn't a help thread, and is focused on the code
> development.Sorry for this being off topic, but not sure where else to ask.
>
> I have been googling for a bit and I can't find any information about
> creating tasklets from C code or how to drive the scheduler from C code.
>
> I have a separate Pthread that is running my python, (main thread is doing
> OpenGL render) and I would like to be able to add tasklets from C code, and
> also start the scheduler from there. I took a look at several of the
> headers and haven't found anything like the PyRun_InteractiveLoop function.
>
> Is this just a case of needing to run a chunk of python code from C that
> creates the first tasklet, and starts the scheduler?
>
> I would like to do
> * create a tasklet to manage a interactive python shell , never ends until
> exit called)
> * Start the scheduler.
>
> In the future I would like to be able to trigger events in python by
> creating a tasklet for the python function and inject it into the
> scheduler. (after making sure it gets to the right pthread)
>
> thanks.
>
> --
> Life: Bah, I will worry about it when it is over.
>



More information about the Stackless mailing list