HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
wahern
cqueues
C2016–2021
wahern / cqueues

cqueues

Continuation Queues: Embeddable asynchronous networking, threading, and notification framework for Lua on Unix.

2Distinct people
5Mentions
0Explicit recommenders
282GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Continuation Queues: Embeddable asynchronous networking, threading, and notification framework for Lua on Unix.

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 8–Nov 15 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/15/2026, 12:45:45 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year5 dated mentions

Observed mentions: 2016-11-03 20:05:30 UTC to 2021-05-20 02:39:27 UTC.

0122016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20162017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments20182019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2021

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC101
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC000
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC000
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC101
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC101
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC202

What Hacker News says

1 sources
IMPLEMENTATION NOTES The pselect() function is implemented in the C library as a wrapper around select(). That means it's not actually compliant. pselect needs to _atomically_ unblock signals so that if any signal handlers are invoked pselect returns EINTR error. User code can't emulate the correct semantics because there's a race between unblocking (i.e. changing the signal mask), checking for signal arrival, and calling select. It's _impossible_ to fix this race without resort to pselect, or by use of system extensions like kqueue on BSD/macOS[1] or signalfd on Linux, which can be tricky. On Solaris you just have to use pselect, or resort to the so-called "pipe trick". So the fact that pselect is a wrapper around select admits that it's not conformant. It's basically useless; worse, it's dangerous because application code calli
Read the rest
ng pselect expecting there won't be a race. You can see the race with this code, which on 10.10.5 still fails. What should happen is that it exits immediately with OK. What actually happens on macOS is that its pselect wrapper unblocks the signal, which is immediately delivered. But by then we've already checked that interrupted was still 0. It then calls select, which will timeout because it won't be interrupted--the signal was already delivered. On every other platform implementing pselect (which all do it correctly), pselect will always return EINTR because the signal unmasking and delivery happens in the kernel _after_ entering select. #include <errno.h> #include <signal.h> #include <stdio.h> #include <sys/select.h> #include <unistd.h> #include <err.h> static int interrupted; static void interrupt(int signo) { interrupted = signo; } int main(void) { struct timespec timeout = { 3, 0 }; sigset_t empty, block; int n; sigemptyset(&empty); sigemptyset(&block); sigaddset(&block, SIGHUP); sigprocmask(SIG_BLOCK, &block, NULL); signal(SIGHUP, &interrupt); raise(SIGHUP); while (!interrupted) { /* * If pselect does not atomically unblock signals, pselect * will never be interrupted and we'll lose the signal until * something else wakes us up AND we remember to check even * though we never saw EINTR. */ n = pselect(0, NULL, NULL, NULL, &timeout, &empty); if (n == -1 && errno != EINTR) { err(1, "pselect"); } else if (n == 0) { errx(1, "timed out"); } } if (interrupted != SIGHUP) errx(1, "wrong signal (got %d, expected %d)", interrupted, SIGHUP); puts("OK"); return 0; } [1] FWIW, here's a correct implementation of pselect for macOS using kqueue. (https://github.com/wahern/cqueues/blob/snap-20160812/src/cqu...) The only caveat is that creating a kqueue descriptor might fail, and you don't normally expect pselect to fail with EMFILE or ENFILE; it might even make it non-compliant. Except for that caveat, it's a compliant implementation of pselect AFAICT.
In Darling – MacOS translation layer for Linux

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.