[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: lua_newthread: is this essentially creating a coroutine?
- From: Klaus Ripke <paul-lua@...>
- Date: Fri, 16 Sep 2005 09:06:49 +0200
On Fri, Sep 16, 2005 at 02:19:33PM +1000, David Morris-Oliveros wrote:
> Yes, lua_newthread creates a coroutine with a new (sub) lua_State. You
> then start it with lua_resume(). It won't block other coroutines, since
> you have to timeslice them anyway manually.
> Does this make sense?
> Edwin Eyan Moragas wrote:
> >Hi guys,
> >does lua_newthread create a new thread (OS thread)
> >or does it create a coroutine pushed to the existing
> >lua state?
> >what i'm trying to find out is if this new lua thread
> >created by lua_newthread will block other
> >existing lua threads (ie, coroutines).
in other words:
no, it does not create an OS thread, and
yes, a blocking operation in any coroutine
blocks the whole process :)