topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Friday April 19, 2024, 10:56 pm
  • Proudly celebrating 15+ 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 4398 times)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,900
    • 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 PM »
Interesting:

http://xmailserver.org/libpcl.html


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 <[email protected]> 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]