Re: [dev] "channel" construct for inter-thread communication in C programs

From: Corey Thomasson <cthom.lists_AT_gmail.com>
Date: Thu, 9 Sep 2010 08:01:46 -0400

libtask [ http://swtch.com/libtask/ ] implements something
similar/same; however, it's a coroutine lib and I'm pretty sure it
will not work with multiple threads.

However, it does have something like a select() for channels, see the
Alt structure and associated methods, IIRC the implementation is
fairly simple.

On 9 September 2010 07:21, Mate Nagy <mnagy_AT_port70.net> wrote:
> Hello all,
>
> I guess I can't get enough of the punishment I always get in these
> threads. Announcing project:
>
> http://repo.hu/projects/cchan/
>
> 'This is a small library that implements a "channel" construct for
> inter-thread communication in C programs. '
>
> This is a very small and simple lib that does one thing only.
> It uses mutexes and conds for synchronization; it is interfaced to the
> thread API using a very thin .h file with macros. It would be probably
> quite easy to port it to use other thread APIs. Currently it supports
> pthreads and SDL threads.
>
> Doesn't use C99 or gcc-specific features, hopefully.
>
> Future development: would be nice to implement a select() operation for
> listening on multiple channels at once; would probably also be very
> complicated.
>
> Regards,
>  Mate
>
> PS. I'm fully aware that Plan 9 has this functionality built in. Not
> interested in "you should use plan9 and/or plan9 portability libs" mails
> thanx
>
>
Received on Thu Sep 09 2010 - 14:01:46 CEST

This archive was generated by hypermail 2.2.0 : Thu Sep 09 2010 - 14:12:02 CEST