chan
chan copied to clipboard
Pure C implementation of Go channels.
This seems to be a great feature C2x could use. Have you though about putting a proposal with this code?
10,000,000 mil channel possible? coz may hit linux thread creation limit? chan_t* chan = chan_init(10000000); 1. i've checked the c code, uses pthreads. am i wrong? this will create 10mil...
https://github.com/tylertreat/chan/blob/b4120abe5d642284182f04965e793cc918daf711/src/chan.c#L407 https://github.com/tylertreat/chan/blob/b4120abe5d642284182f04965e793cc918daf711/src/chan.c#L444 In the implementation of `chan_select`, it first checks every channel to see if it can recv/send. After that it randomly select one and do the recv/send. What about...
it would be great if there was a size param, so this library can be drop-in replaced with a compatible api for passing messages between processes.
I written a test which compares the number of transfered messages per millisec to the number of threads. I'm using a similar test for the lock-free iqueue. The file is...
Currently, chan provides `chan_send` to send data by `void*` argument. But someone may want to send int/long/double/char etc. How do you think? And I worry about someone may mistake to...
`chan_select` currently only supports non-blocking selects. It should also support blocking selects, maybe by passing in a flag.