1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-30 15:13:03 +00:00

Initial working draft of threaded channels.

Introduces close semtantics to channels as well, but otherwise
threaded channels behave much like non-threaded channels. They have
different marshalling behavior though, and can only send values over by
packing and unpacking them. For now, this means only primitive values
although this will be expanded.

Also missing some implementation for closing threaded channels, and a
whole lot of testing. Achtung!, Caveat emptor, here be dragons and bugs.
This commit is contained in:
Calvin Rose
2021-08-15 11:48:13 -05:00
parent c94d7574bc
commit 037215f7c4
4 changed files with 398 additions and 54 deletions

View File

@@ -160,6 +160,7 @@ struct JanetVM {
size_t listener_count;
size_t listener_cap;
size_t extra_listeners;
JanetTable channel_map; /* threaded channel lookup table, no gc */
#ifdef JANET_WINDOWS
void **iocp;
#elif defined(JANET_EV_EPOLL)