Hi,

On Tue, Sep 8, 2015 at 11:44 AM, Yicong Huang <hengha....@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.
_______________________________________________
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to