[pypy-dev] Segmentation fault at rpyvmprof_f_pypy_rrr ()
Armin Rigo
arigo at tunes.org
Tue Sep 8 13:34:40 CEST 2015
Hi,
On Tue, Sep 8, 2015 at 11:44 AM, Yicong Huang <hengha.mao at gmail.com> 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 problems if main thread exit before other worker thread do
> the initilization "pypy_thread_attach()"?
No, it should not be a problem.
Note that every pypy_thread_attach() call leaks a bit of memory right
now. If your program has a lot of threads that exit and new threads
that replace them, then you'll really have a leak. I hope it is not
the case for you. Otherwise, we need to think about adding some
function like "pypy_thread_detach()"...
A bientôt,
Armin.
More information about the pypy-dev
mailing list