Performance characteristics of pthreads vs ucontext
Posted
by
Robert Mason
on Stack Overflow
See other posts from Stack Overflow
or by Robert Mason
Published on 2012-10-30T16:58:45Z
Indexed on
2012/10/30
17:00 UTC
Read the original article
Hit count: 241
I'm trying to port a library that uses ucontext over to a platform which supports pthreads but not ucontext. The code is pretty well written so it should be relatively easy to replace all the calls to the ucontext API with a call to pthread routines. However, does this introduce a significant amount of additional overhead? Or is this a satisfactory replacement. I'm not sure how ucontext maps to operating system threads, and the purpose of this facility is to make coroutine spawning fairly cheap and easy.
So, question is: Does replacing ucontext calls with pthread calls significantly change the performance characteristics of a library?
© Stack Overflow or respective owner