79 questions
5
votes
1
answer
343
views
How to do infinite (or really deep) recursions in Stackless Python?
I know standard CPython has a limit on recursion depth, less than 1000 I think, so the below example code will fail with a "maximum recursion depth exceeded" error.
def rec_add(x):
if x == 0:
...
1
vote
2
answers
3k
views
Embedded python not picking up PYTHONPATH
I have a really weird problem with embedding python. If I don't specify PYTHONPATH, Py_Initialize fails with ImportError: No module named site.
If I set PYTHONPATH in cmd and then run my program, it ...
3
votes
1
answer
483
views
parallel computations with task manager
I need to run some parallel computations in python. The only compatible approach I can think of is the multiprocess/fork model, which is less than ideal for several reasons:
from what I understand, ...
1
vote
1
answer
1k
views
Couldn't find index page for 'stackless_installer_c4_win32' (maybe misspelled?)
I am trying to install stackless python. I have tried
pip install stackless-python
easy_install stackless-python
python -m pip install stackless-python
I have done all these and also the same with an ...
1
vote
0
answers
107
views
Factory returning boost exposed python object seg faults
I am having a wicked problem with exposing a polymorphic class hierarchy via a factory. I have created an example that demonstrates the problem.
This is all being hosted in a executable with an ...
0
votes
0
answers
235
views
stackless python and multiprocessing slowdown
I have a program that runs multiple tasklets using stackless python, and my problem is that though it is fast, I do notice a slowdown if I start one or more processes that run the same code.
For ...
1
vote
1
answer
59
views
python program without stackless.run()
How the below program execute my member A.fun without calling stackless.run() in the program?
import stackless
class A:
def __init__(self,name):
self.name = name
self.ch = ...
3
votes
1
answer
135
views
Sleep instead of thread.join() for platform legacy reasons
Working on a git fork of someone's code, I came across the following, there to halt the master thread until such a time as all the sub-threads are done:
while(True):
if not any([thread.isAlive() ...
1
vote
0
answers
66
views
How robust is `func(*argument)`? [duplicate]
In python, you can expand a sequence into discrete function arguments with the star operator:
args = [2, 3]
print(pow(*args)) # same as `print(pow(2, 3))`
There's even a nice idiom for transposing a ...
1
vote
1
answer
166
views
Create tasklets at runtime
Just starting with Stackless Python. I'm trying to create some tasklets at run time, that is, after calling stackless.run(). I thought this function wouldn't block the main thread, so I would be able ...
2
votes
0
answers
51
views
How can I use stackless python on heroku?
I'm trying to use stackless python for a heroku app, but they don't support the runtime:
! Requested runtime (stackless-3.3.5) was not found.
This is surprising, since stackless-3.3.5 was ...
3
votes
2
answers
264
views
Aren't Python tasklets breaking the rule of no "GOTO"?
I've made a huge google research about Stackless Python's tasklets.
Every source mentions it as a thread
stackless.com : Microthreads: tasklets wrap functions allowing them to be launched as ...
0
votes
2
answers
129
views
stackless python constructor
import stackless
class MyTasklet(stackless.tasklet):
def __init__(self, func, msg):
pass
def foo():
pass
msg = 'hello'
MyTasklet(foo, msg)()
I am using stackless python, this code ...
1
vote
0
answers
513
views
PyCharm can't resolve stackless
I am using PyCharm 3 on OS X. I've configured a Python Stackless binary in virtual env to be used as a project interpreter. It runs okay, and imports stackless module, but in the editor it is showed ...
0
votes
2
answers
754
views
Install Stackless without uninstalling Python
It seems like on Windows I have to uninstall Python before installing stackless (http://stackless.com/wiki/Download). I have Python 2.7 installed, a solution may be installing Stackless Python 3.2, ...
1
vote
5
answers
2k
views
How to pass arguments to a python greenlet as additional arguments
I'm looking for a way to pass function arguments through another function, in a manner identical to Stackless' tasklet instantiation:
stackless.tasklet(function_being_called)(*args)
So far the best ...
0
votes
1
answer
421
views
Implementing Stackless Python
I really admire the functionality of Stackless Python, and I've been looking around for a way to emulate its syntax while still using the standard Python 3 interpreter. An article by Alex J. ...
2
votes
2
answers
301
views
Using Stackless Python to save the state of a large running program?
Given a large (4.5 GB codebase) python testing framework whose execution involves many tens of files, many of which are not directly pickle-able, is it possible to wrap initial execution of the ...
3
votes
3
answers
832
views
Python Is it possible to recreate a whole call stack?
I'm interested in experimenting with python. I know I can inspect and inject local and global variables into a frame using frame.f_locals and frame.f_globals, but I am now itching to create a full ...
2
votes
2
answers
3k
views
Python Handling large number of Threads?
# data is a list
Threading_list=[]
class myfunction(threading.Thread):
def __init__(self,val):
.......
.......
def run(self):
.......
.......
for i in ...
1
vote
1
answer
139
views
Output missing when stderr points to file on multi-threaded stackless python script
Consider the following four lines (all identical) which produce the same number of lines from a log file:
$ zcat test-catalog.xml.gz | bin/process-catalog.py -b build -T 4 - 2>&1 | wc -l
620
$ ...
5
votes
3
answers
602
views
What "kind" of Python to start with? [closed]
I want to learn python so I downloaded it from the python site and I saw 4 other kinds of pythons appear:
Python (normal)
IronPython
Jython
PyPy
Stackless Python
I can really find what the differents ...
3
votes
3
answers
904
views
Simulating threads scheduling in java (stackless java?)
For some academic research I need to simulate several threads running on a single processor.
I want to be able to insert *call_scheduler()* calls inside my code, in which the current "thread" will ...
1
vote
0
answers
179
views
stacklesssocket affects other socket based module
I have a project using Stackless Python with stacklesssocket.py. I recently decided that I wanted to add Couchbase to my project to server as my database back-end. I did this following the ...
13
votes
1
answer
983
views
What is the preferred method for TCP/IP IPC in stackless Python?
Stackless python allows you to serialize a task (pickling) for later execution that need not be on the same machine:
http://www.stackless.com/wiki/Pickling
My question is does stackless python ...
2
votes
3
answers
309
views
Is it possible to use stackless python 2.7.2 with pythondotnet?
Platform: Windows 7
Assume 32bit versions of both.
My current understanding is that it is NOT possible since both installation processes involve replacing the python.exe itself.
I guess the source ...
1
vote
2
answers
1k
views
Can not import stackless after stackless python installation
I used pycharm and eclipse+pydev, and I also installed stackless python(2.7.1) for mac os x.
when I try to import stackless, there always are tips which is "can't find such package/reference", but ...
4
votes
1
answer
736
views
Why PyPy 1.7 desn't implement "stackless" stack?
Default build of PyPy 1.7 with stackless included in, does not offer the ability to run with no recursion depth limit (in straight way).
Why?
Previus builds of PyPy with stackless support ...
16
votes
1
answer
5k
views
Stackless in PyPy and PyPy + greenlet - differences
New version of PyPy ships with integrated Stackless.
As far as I know the bundled Stackless is not the same as the origin Stackless from 2001 with continuations. So mainly it is the green threads ...
8
votes
2
answers
4k
views
Need suggestion about MMORPG data model design, database access and stackless python [closed]
I'm engaged in developing a turn-based casual MMORPG game server.
The low level engine(NOT written by us) which handle networking,
multi-threading, timer, inter-server communication, main game loop ...
46
votes
2
answers
18k
views
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 ...
2
votes
4
answers
883
views
Segfault in the C code when using a Python tool called guppy ( heapy )
So I am using Python Stackless with heapy on two diffrent machines with the same architectures but slightly different C compilers. Heapy works perfectly fine on the first one, but I get a core dump ...
3
votes
2
answers
2k
views
Stackless Python - Recursion in a for loop?
I'm fairly new to programming and I've been working with Python for a few months now. I'm trying to get a concept to work with Stackless, but just can't figure out how (though I've written other test ...
3
votes
1
answer
232
views
Tasklets Local Storage in Stackless Python
I'm starting with Stackless Python so it's a whole new amazing world for me.
I usually use regular threads, and they normally have Thread-local storage (TLS), which
is a very useful feature when you ...
17
votes
2
answers
2k
views
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.
...
5
votes
1
answer
509
views
Stackless Python development using Python Tools for Visual Studio
Does the Python Tools for Visual Studio Beta, which includes support for CPython, allow you to develop in Stackless Python?
If so, could you expand your answers to include any of the steps necessary ...
14
votes
7
answers
4k
views
Erlang-like concurrency for Python?
Is there anything for Python that has concurrency like Erlang does, particulary transparent actors over networks? I've looked at things like greenlet and stackless, but they don't seem to have network ...
2
votes
3
answers
764
views
Is there something similar to Stackless Python available in C#?
Is there something similar to Stackless Python, i.e. a framework that supports continuations, microthreads and lightweight processes in C#? I know that C# 5 is going to support partially some of these ...
2
votes
1
answer
255
views
Why Is My Stackless Executable So Much Smaller
I wrote a few games for a competition in Stackless Python and needed to create an executable. Accidentally though, I used CPython 2.6 instead of using Stackless Python 2.5 to build the executable. I ...
3
votes
5
answers
211
views
Is there such a thing as working threading in python?
I wrote a beautiful multithreaded script, and when I ran it, it performed worse with 25 threads than with just direct invocation of the thread handler.
Then I discovered the global interpreter lock. ...
31
votes
3
answers
8k
views
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 ...
2
votes
1
answer
459
views
Sandboxed AND stackless python?
I need a scripting language for describing very complicated workflows.
These workflows need to be paused
whenever user input is required, and
resumed after it is given (could be
months later). Seems ...
4
votes
1
answer
2k
views
What's the advantage of Stackless Python's microthread than Lua's coroutine in state machine implementation for game?
Are there any advantages to Stackless Python implementation over Lua's coroutines?
What's the difference between them?
2
votes
1
answer
141
views
In stackless python, is data sent over a channel immutable?
I have a typical producer, consumer pattern. If the producer sends an object over a channel, the producer is blocked until the consumer accepts the object. After the consumer accepts the object, the ...
0
votes
2
answers
658
views
design for continuation based python web appliction framework
There are many continuation based framework for java, ruby etc but none in python. Nagare framework somewhat solves the problem but it do not use standard python and uses stackless python to solve ...
18
votes
7
answers
21k
views
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 ...
0
votes
2
answers
443
views
nagare framework on gae?
anyone using nagare framework on google app engine ?
it seems interesting, but i could not find any documentaiton on how to use it on
google app engine, as it uses stackless python.
so any chances ...
46
votes
6
answers
27k
views
Which Actor model library/framework for python and Erlang-like? [closed]
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 ...
1
vote
1
answer
373
views
Retrieving the Return Value of a Stackless Python Tasklet Bound Function?
Stackless Experts,
I have managed to create tasklets under Stackless Python (both from the Stackless and the C side).
It seems to me that in order to create a tasklet in Stackless, you bind an ...
35
votes
4
answers
22k
views
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 ...