Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 08, 2016, 10:16:33 AM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: The Portable Coroutine Library (PCL)  (Read 2664 times)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,412
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
The Portable Coroutine Library (PCL)
« on: February 09, 2006, 03:41:07 PM »
Interesting:

http://xmailserver.org/libpcl.html


Quote
The Portable Coroutine Library (PCL) implements the low level functionality for coroutines. For a definition of the term coroutine see The Art of Computer Programming by Donald E. Knuth. Coroutines are a very simple cooperative multitasking environment where the switch from one task to another is done explicitly by a function call. Coroutines are a lot faster than processes or threads switch, since there is no OS kernel involvement for the operation. Also coroutines require much less OS resources than processes of threads. The idea of writing this library started when I was testing Linux epoll functionality and performance. I initially started using the coro library by E. Toernig <froese@gmx.de> and I found the library very interesting. It was simple and yet powerful. The limitations of the coro library were both non portability and crashes when not used together with certain versions of gcc. So I decided to write a new library to address the problems aforementioned by also taking portable context switching ideas from the GNU Pth library. This library is easily portable on almost every Unix system and on Windows. It can use either the ucontext.h functionalities ( getcontext()/makecontest()/swapcontext() ) or the standard longjmp()/setjmp().


[link from freeware world team]