Re: [pypy-dev] Could PyPy have finalize() method or could be initialized thread by thread ?

2015-09-08 Thread Yicong Huang
Hi Maciej The minimal program is as below: nt main() { rpython_startup_code(); pypy_init_threads(); pypy_setup_home(...); pypy_execute_source_ptr("print \'hello\'"); } It hangs in pypy_execute_source(). And if we remove "pypy_init_threads()", the code works. With gdb debug, it blocked at thi

Re: [pypy-dev] Could PyPy have finalize() method or could be initialized thread by thread ?

2015-09-08 Thread Maciej Fijalkowski
do you have a minimal example where it doesn't work? did you try a very minimal program? On Tue, Sep 8, 2015 at 5:00 PM, Yicong Huang wrote: > With gdb debug, it blocked at this stack: > > #0 0x003fea40b1c0 in pthread_cond_timedwait@@GLIBC_2.3.2 () from > /lib64/libpthread.so.0 > #1 0x7

Re: [pypy-dev] Could PyPy have finalize() method or could be initialized thread by thread ?

2015-09-08 Thread Yicong Huang
With gdb debug, it blocked at this stack: #0 0x003fea40b1c0 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0 #1 0x76369305 in RPyGilAcquire () from .//../dist/libpypy-c.so #2 0x755bb8ed in pypy_g_pypy_execute_source_ptr () from .//../dist/libpypy-c.so #3

Re: [pypy-dev] Could PyPy have finalize() method or could be initialized thread by thread ?

2015-09-08 Thread Yicong Huang
Hi Armin, Sorry for I didn't describe the problem clearly. The issue is well reproducible with the belolw simple piece of the code: #include ... int main() { rpython_startup_code(); pypy_init_threads(); pypy_setup_home(...); pypy_execute_source_ptr("print \'hello\'"); } It hangs in pypy_exe

Re: [pypy-dev] Could PyPy have finalize() method or could be initialized thread by thread ?

2015-09-08 Thread Armin Rigo
Hi Yicong, On Tue, Sep 8, 2015 at 1:57 PM, Yicong Huang wrote: > I tried the following in one thread, and it hang in > pypy_execute_source_ptr(). > * rpython_startup_code(); > * pypy_init_threads(); > * pypy_setup_home(...) > * pypy_execute_source_ptr() I meant "do whatever you d

Re: [pypy-dev] Python CI and CD support available on Semaphore (feedback appreciated) (fwd)

2015-09-08 Thread Laura Creighton
In a message of Tue, 08 Sep 2015 12:36:49 +0200, Laura Creighton writes: >This showed up on python-list. Should we try to get them to >make PyPy a supported Python? > >Laura Ha! PyPy is _already_ a supported system. And Filip wants to know if there is anything else he can do to make things easi

Re: [pypy-dev] Could PyPy have finalize() method or could be initialized thread by thread ?

2015-09-08 Thread Yicong Huang
Hi Armin, I tried the following in one thread, and it hang in pypy_execute_source_ptr(). * rpython_startup_code(); * pypy_init_threads(); * pypy_setup_home(...) * pypy_execute_source_ptr() On Tue, Sep 8, 2015 at 7:40 PM, Armin Rigo wrote: > Hi Yicong, > > On Tue, Sep 8, 2015 at

Re: [pypy-dev] Could PyPy have finalize() method or could be initialized thread by thread ?

2015-09-08 Thread Armin Rigo
Hi Yicong, On Tue, Sep 8, 2015 at 1:35 PM, Yicong Huang wrote: > The process looks like: > Main process create thread pool -> thread 1 initialized Pypy-> thread 1 run > Python code -> thread 1 finish -> thread 1 finalize Pypy -> thread 2 > initialized Pypy -> thread 2 run Python code -> thread 2

Re: [pypy-dev] Segmentation fault at rpyvmprof_f_pypy_rrr ()

2015-09-08 Thread Armin Rigo
Hi, On Tue, Sep 8, 2015 at 11:44 AM, Yicong Huang wrote: > In main thread: > rpython_startup_code(); > pypy_init_threads(); > res = pypy_setup_home(..); > > And in other worker thread, after main thread do the initilization: > pypy_thread_attach(); Yes, that's how it should be. > Will there any

[pypy-dev] Could PyPy have finalize() method or could be initialized thread by thread ?

2015-09-08 Thread Yicong Huang
Hi, Our scenario is we had a main process, and it will create severl worker threads. Python code is running in worker threads. >From PyPy document, we should do the following: In main process: rpython_startup_code(); pypy_init_threads(); pypy_setup_home(...) And in worker thread that need to exec

[pypy-dev] Python CI and CD support available on Semaphore (feedback appreciated) (fwd)

2015-09-08 Thread Laura Creighton
This showed up on python-list. Should we try to get them to make PyPy a supported Python? Laura --- Forwarded Message Subject: Python CI and CD support available on Semaphore (feedback appreciated) From: =?UTF-8?Q?Filip_Komnenovi=C4=87?= HI folks, We have recently launched Python suppor

Re: [pypy-dev] Segmentation fault at rpyvmprof_f_pypy_rrr ()

2015-09-08 Thread Yicong Huang
Great thanks Armin! I found out we did call python code from different theads. Here are my understanding, please correct me if I am wrong: In main thread: rpython_startup_code(); pypy_init_threads(); res = pypy_setup_home(..); And in other worker thread, after main thread do the initilization: py

Re: [pypy-dev] Segmentation fault at rpyvmprof_f_pypy_rrr ()

2015-09-08 Thread Armin Rigo
Hi, On Tue, Sep 8, 2015 at 9:20 AM, Yicong Huang wrote: > Here are the output of gdb "info threads". We didn't call > "pypy_init_threads()" or "pypy_thread_attach()" in the code. Well, then. Read again the documentation for these two functions: you need to call them if your program is going to

Re: [pypy-dev] Segmentation fault at rpyvmprof_f_pypy_rrr ()

2015-09-08 Thread Yicong Huang
Here are the output of gdb "info threads". We didn't call "pypy_init_threads()" or "pypy_thread_attach()" in the code. (gdb) info threads Id Target Id Frame 132 Thread 0x414ea940 (LWP 32385) 0x003472ad4d98 in epoll_wait () from /lib64/libc.so.6 131 Thread 0x413e9940 (LWP 32384