Questions tagged [python-stackless]

Stackless Python is an experimental implementation of the Python language; Stackless was designed from the start to overcome the limitations of cPython's Global Interpreter Lock by using tasklets, which implement functions as microthreads.

Stackless Python is an experimental implementation of the Python language; Stackless was designed from the start to overcome the limitations of cPython's Global Interpreter Lock by using tasklets, which implement functions as microthreads.

From the Stackless Python web site:

Stackless Python is an enhanced version of the Python programming language. It allows programmers to reap the benefits of thread-based programming without the performance and complexity problems associated with conventional threads. The microthreads that Stackless adds to Python are a cheap and lightweight convenience which can if used properly, give the following benefits:

  • Improved program structure.
  • More readable code.
  • Increased programmer productivity.
80 questions
136
votes
4 answers

What are the drawbacks of Stackless Python?

I've been reading recently about Stackless Python and it seems to have many advantages compared with vanilla cPython. It has all those cool features like infinite recursion, microthreads, continuations, etc. and at the same time is faster than…
Ryszard Szopa
  • 5,431
  • 8
  • 33
  • 43
78
votes
7 answers

Threading in Python

What are the modules used to write multi-threaded applications in Python? I'm aware of the basic concurrency mechanisms provided by the language and also of Stackless Python, but what are their respective strengths and weaknesses?
Jonathan Holloway
  • 62,090
  • 32
  • 125
  • 150
46
votes
2 answers

Why can't generators be pickled?

Python's pickle (I'm talking standard Python 2.5/2.6/2.7 here) cannot pickle locks, file objects etc. It also cannot pickle generators and lambda expressions (or any other anonymous code), because the pickle really only stores name references. In…
Radim
  • 4,208
  • 3
  • 27
  • 38
46
votes
6 answers

Which Actor model library/framework for python and Erlang-like?

I am looking for an easy-to-learn Actor library or framework for Python 2.x. I have tried Candygram and Twisted but I did not like them. I'd like something that will be easy to extend to suppero Greenlet (= stackless python). Candygram is too…
daitangio
  • 583
  • 1
  • 6
  • 18
44
votes
6 answers

What would I use Stackless Python for?

There are many questions related to Stackless Python. But none answering this my question, I think (correct me if wrong - please!). There's some buzz about it all the time so I curious to know. What would I use Stackless for? How is it better than…
zaharpopov
  • 16,882
  • 23
  • 75
  • 93
36
votes
4 answers

Eventlet or gevent or Stackless + Twisted, Pylons, Django and SQL Alchemy

We're using Twisted extensively for apps requiring a great deal of asynchronous io. There are some cases where stuff is cpu bound instead and for that we spawn a pool of processes to do the work and have a system for managing these across multiple…
Khorkrak
  • 3,911
  • 2
  • 27
  • 37
31
votes
7 answers

Python Comet Server

I am building a web application that has a real-time feed (similar to Facebook's newsfeed) that I want to update via a long-polling mechanism. I understand that with Python, my choices are pretty much to either use Stackless (building from their…
HenryL
  • 543
  • 1
  • 6
  • 10
31
votes
3 answers

Python/Erlang: What's the difference between Twisted, Stackless, Greenlet, Eventlet, Coroutines? Are they similar to Erlang processes?

My incomplete understanding is that Twisted, Stackless, Greenlet, Eventlet, Coroutines all make use of async network IO and userland threads that are very lightweight and quick to switch. But I'm not sure what are the differences between them. Also…
Continuation
  • 12,722
  • 20
  • 82
  • 106
28
votes
5 answers

Python Global Interpreter Lock (GIL) workaround on multi-core systems using taskset on Linux?

So I just finished watching this talk on the Python Global Interpreter Lock (GIL) http://blip.tv/file/2232410. The gist of it is that the GIL is a pretty good design for single core systems (Python essentially leaves the thread handling/scheduling…
user31056
25
votes
1 answer

Stackless python and multicores?

So, I'm toying around with Stackless Python and a question popped up in my head, maybe this is "assumed" or "common" knowledge, but I couldn't find it actually written anywhere on the stackless site. Does Stackless Python take advantage of multicore…
thr
  • 19,160
  • 23
  • 93
  • 130
24
votes
9 answers

Multiprocessing or Multithreading?

I'm making a program for running simulations in Python, with a wxPython interface. In the program, you can create a simulation, and the program renders (=calculates) it for you. Rendering can be very time-consuming sometimes. When the user starts a…
Ram Rachum
  • 84,019
  • 84
  • 236
  • 374
23
votes
7 answers

Is it possible to programmatically construct a Python stack frame and start execution at an arbitrary point in the code?

Is it possible to programmatically construct a stack (one or more stack frames) in CPython and start execution at an arbitrary code point? Imagine the following scenario: You have a workflow engine where workflows can be scripted in Python with…
18
votes
7 answers

Why does the Python/C API crash on PyRun_SimpleFile?

I've been experimenting with embedding different scripting languages in a C++ application, currently I'm trying Stackless Python 3.1. I've tried several tutorials and examples, what few I can find, to try and run a simple script from an…
Sion Sheevok
  • 4,057
  • 2
  • 21
  • 37
18
votes
5 answers

Python on an Real-Time Operation System (RTOS)

I am planning to implement a small-scale data acquisition system on an RTOS platform. (Either on a QNX or an RT-Linux system.) As far as I know, these jobs are performed using C / C++ to get the most out of the system. However I am curious to know…
Gökhan Sever
  • 8,004
  • 13
  • 36
  • 38
17
votes
2 answers

Is it possible to embed PyPy into a .NET application?

I would like to embed a Python interpreter into my .NET application. I'm aware of IronPython, of course, but I'm specifically interested in PyPy, because of its stackless support and microthreads. However, while PyPy can be built against the CLI, it…
Joe White
  • 94,807
  • 60
  • 220
  • 330
1
2 3 4 5 6