On Sun, Nov 02, 2014 at 01:38:37PM +0100, Gustaf Neumann wrote:

> I've changed the code by using distinct bit-patterns for signal
> detection which should address the problem, but have just
> checked that  the changes compile correctly under windows.

That seems to fix the excess rolling problem on Windows, thanks!

> However, i've not located the code, where SIGHUP is handled
> on the windows side. Andrew, how do you send SIGHUP to nsd?

The Windows SIGHUP handling is in NsHandleSignals() in nsd/nswin32.c,
which you just fixed, right?

Hm, how come NsSendSignal() only supports NS_SIGTERM, NS_SIGINT, and
NS_SIGHUP, with no support for NS_SIGQUIT and NS_SIGPIPE ?

> Andrew, how do you send SIGHUP to nsd?

In the distant past on either Linux or Solaris, I think I used an
external shell script to send an external SIGHUP to the nsd process,
but I never do that anymore.

On Windows, the only way I've ever done it is by explicitly calling
ns_logroll from the nsd process itself, typically in a scheduled
procedure.

In nsd/log.c, LogOpen() uses Ns_RegisterAtSignal() with Ns_LogRoll()
for handling an incoming SIGHUP.  But, the ns_logroll Tcl command
simply explicitly calls Ns_LogRoll(), so I don't think it exercises
the signal-handling machinery at all.

Btw, I just got a copy of this book and read some of it:

  http://www.amazon.com/gp/product/0321657748/
  Windows System Programming, 4th Edition; by Johnson M. Hart
  published Feb. 2010; ISBN-13:  978-0321657749

It seems pretty good, and has some useful compare/contrast discussion
of Windows vs. POSIX thread synchronization APIs.  Instead of Unix
signals, Windows uses Console Control Handlers or Exceptions
(depending on what you're trying to do).  Naviserver uses a Console
Control Handler.

-- 
Andrew Piskorski <a...@piskorski.com>

------------------------------------------------------------------------------
_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to