On Thursday, 15 March 2018 at 19:43:09 UTC, Patrick Schluter
wrote:
On Thursday, 15 March 2018 at 16:51:59 UTC, Jim King wrote:
I am trying to add graceful shutdown support to a test harness.
In the test harness, a server class consumes a thread to
accept connections and service them. In
On Thursday, 15 March 2018 at 16:51:59 UTC, Jim King wrote:
I am trying to add graceful shutdown support to a test harness.
In the test harness, a server class consumes a thread to
accept connections and service them. In order to stop the
server, it has to be interrupted. This interruption
On Thursday, 15 March 2018 at 19:36:44 UTC, Patrick Schluter
wrote:
On Thursday, 15 March 2018 at 19:23:26 UTC, Dmitry Olshansky
wrote:
On Thursday, 15 March 2018 at 17:30:50 UTC, Jim King wrote:
[...]
Another option if you are on linux is to use eventfd. Then you
can trigger it with simple
On Thursday, 15 March 2018 at 19:23:26 UTC, Dmitry Olshansky
wrote:
On Thursday, 15 March 2018 at 17:30:50 UTC, Jim King wrote:
[...]
Another option if you are on linux is to use eventfd. Then you
can trigger it with simple write on eventfd descriptor.
As far as waiting goes it’s either
On Thursday, 15 March 2018 at 17:30:50 UTC, Jim King wrote:
On Thursday, 15 March 2018 at 17:12:24 UTC, Adam D. Ruppe wrote:
On Thursday, 15 March 2018 at 16:51:59 UTC, Jim King wrote:
In going through the signal documentation it looks like the
signal handler must be a "nothrow @nogc" variety.
Alternatively btw you can use the pthreads C functions
import core.sys.posix.pthread;
which shuld also be nogc right now. The condition class wraps
those on Linux fairly thinly; using the C functions should be
little more trouble.
On Thursday, 15 March 2018 at 17:30:50 UTC, Jim King wrote:
The problem with that is that it requires a busy loop to detect
it.
well, what's your thread doing? In the case I used this pattern,
it was blocking on a call to select() anyway, so when it returned
with EINTR, that was a good
On Thursday, 15 March 2018 at 17:12:24 UTC, Adam D. Ruppe wrote:
On Thursday, 15 March 2018 at 16:51:59 UTC, Jim King wrote:
In going through the signal documentation it looks like the
signal handler must be a "nothrow @nogc" variety.
Looks like notify actually can throw an exception... the
On Thursday, 15 March 2018 at 16:51:59 UTC, Jim King wrote:
In going through the signal documentation it looks like the
signal handler must be a "nothrow @nogc" variety.
Looks like notify actually can throw an exception... the way I
usually do signal handlers is just set a global variable:
I am trying to add graceful shutdown support to a test harness.
In the test harness, a server class consumes a thread to accept
connections and service them. In order to stop the server, it
has to be interrupted. This interruption mechanism is based on
core.sync.condition.
I want to add a
10 matches
Mail list logo