The main advantage is that the integration with the build() event loop is very clean, as it simply uses a pipe to signal the availability of tokens. Interacting with the job server is entirely embedded within a new token.c file that implements a simple API:
int tokeninit(void);
bool tokenget(struct edge *e);
void tokenput(void);
and on top of this, the integration is about 20 lines of code.
On the other hand token.c uses pthreads, which perhaps could be considered less appealing. Waiting for reviews. :)
Alternative implementation to #94.
The main advantage is that the integration with the
build()
event loop is very clean, as it simply uses a pipe to signal the availability of tokens. Interacting with the job server is entirely embedded within a newtoken.c
file that implements a simple API:and on top of this, the integration is about 20 lines of code.
On the other hand
token.c
uses pthreads, which perhaps could be considered less appealing. Waiting for reviews. :)