lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I read that makecontext/setcontext etc. are deprecated (e.g. on OSX)

http://tch854135.tch.quora.com/Why-is-ucontext-h-setcontext-getcontext-etc-deprecated-on-Mac-OS-X-Is-there-an-equivalent-coroutine-esque-library-or-is-it-all-just-threads-now

On Jan 12, 2012, at 6:32 PM, William Ahern wrote:

> On Thu, Jan 12, 2012 at 04:52:20PM -0800, Joseph Stewart wrote:
>> Maybe this is too much but I've enjoyed messing with "libtask":
>> 
>> http://swtch.com/libtask/
>> 
>> I've used this in conjunction with lua for some non-serious tinkering.
>> You'd get channels and some networking code with this too. I believe Zed
>> Shaw uses pieces of libtask (not my code) in his Mongrel2 server.
>> 
> 
> It, too, uses makecontext(3), swapcontext(3), et al. In fact, all of the
> alternatives given on the list do, AFAICT, because it's the obvious and
> correct way to do it. However, notwithstanding the prevalence of the
> interfaces (*BSD, Linux, and OS X all have them) they've been removed from
> POSIX because all the vendors have abandoned them. The vendors haven't put
> any effort into making them play well with POSIX threads; in particular,
> apparently, thread local storage.
> 
> As long as you're not linking with pthreads, all of the alternatives will be
> equally "robust", lightweight, or what have you. The only differences are
> the appeal of their APIs.
> 
>