Re: Python Embedding Thread

2008-07-22 Thread Jaimy Azle
<[EMAIL PROTECTED]> wrote: > I fixed the code. This code snippet runs in a seperate thread: > > > PyObject *dict=NULL; > PyGILState_STATE state = PyGILState_Ensure(); > dict = CreateMyGlobalDictionary(); > > PyRun_String(, Py_file_input, dict, dict); > > ReleaseGlobalDictionary(dict); > > But it s

Re: Python Embedding Thread

2008-07-21 Thread Jaimy Azle
"Benjamin" <[EMAIL PROTECTED]> wrote: > Two threads should not be running through the Python VM concurrently > in the same process. The GIL has to be held *any* time you use the > Python API. When you want to release the GIL (to process something in > C), use PY_BEGIN_ALLOW_THREADS and > PY_END_AL

Re: Python GC does not work as it should be

2008-06-16 Thread Jaimy Azle
Jean-Paul Calderone wrote: > > There's plenty of things other than that one static variable that can get > messed up in this scenario. The access violation could easily come along > with random memory corruption. Fixing just the GC to handle this doesn't > mean your program will be able to keep

Re: Python GC does not work as it should be

2008-06-16 Thread Jaimy Azle
Jean-Paul Calderone wrote: > > A system exception? What's that? C doesn't have exceptions. > How could I determine it? I dont know GCC implementation, and others, but C on MSVC does have it. My application were not written in C, an exception raised was something like "access violation at addr

Python GC does not work as it should be

2008-06-16 Thread Jaimy Azle
See this piece of code: /* API to invoke gc.collect() from C */ Py_ssize_t PyGC_Collect(void) { Py_ssize_t n; if (collecting) n = 0; /* already collecting, don't do anything */ else { collecting = 1; n = collect(NUM_GENERATIONS - 1); collecting = 0; } return n; } If a system excepti

Python based server Uptime

2008-03-24 Thread Jaimy Azle
Hi, I'm just curious, if anyone ever implement python based application server just like CheryPy, Django, TinyERP, or something else, how many requests do they proceed and what is the longest runing server ever reached before downtime? Salam, -Jaimy. -- http://mail.python.org/mailman/list

Re: Python too slow?

2008-01-16 Thread Jaimy Azle
"Paul Boddie" <[EMAIL PROTECTED]> wrote: > I think the benefits of running Java on CPython are significantly less > than those had by running Python on the Java VM (or another VM). > Firstly, who wants to write statically typed code which then runs on a > virtual machine that can't take advantage

Re: Python too slow?

2008-01-15 Thread Jaimy Azle
"Paul Boddie" <[EMAIL PROTECTED]> wrote: >> >> perhaps in the future another sillly point could be added also, Java has >> Jython, while Python doesn't have some thing like PyJava or... perhaps >> Py-va >> (Python based Java Language). > > You could compile Java to CPython bytecode or, in the case

Re: Python too slow?

2008-01-14 Thread Jaimy Azle
<[EMAIL PROTECTED]> wrote: >> > fact 1: CPython compiles source code to byte-code. >> > fact 2: CPython executes this byte-code. >> > fact 3: Sun's JDK compiles source code to byte-code. >> > fact 4: Sun's JDK executes this byte-code. >> >> Fact 4 is misleading because it is only one option availa

Re: Python too slow?

2008-01-10 Thread Jaimy Azle
"Ed Jensen" <[EMAIL PROTECTED]> wrote: > > Wow, this is pretty misleading. > > Java is, indeed, compiled to bytecode; however, modern JVMs typically > compile the bytecode to native code and then execute the native code. > > CPython strictly interprets bytecode; it does not compile the > bytecode