[mercury-users] problem with signals

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Mar 11 07:04:07 AEDT 2003


On 10-Mar-2003, Pieter Laeremans <pieter.laeremans at student.kuleuven.ac.be> wrote:
> Thx this fixes the compilation problem.  However another problem
> emerged.  The sigprocmask I used to block for signals didn't had an
> effect.  I wondered why now I think I [k]now. 
> 
> ps -e showed me that therre were t[w]o processes of my mercury program. 
> Although I never spawn any thread somewhere. And signals are only
> delivered to one thread. 
> 
> Does the mercury runtime in someway spawns a new thread when a signal
> gets delivered to program ?

No.

The Mercury runtime will create multiple threads only if built in
an *.par* grade, and even then only if you explicitly set the number
of threads (with the MERCURY_OPTIONS environment variable,
or the --runtime-flags option to the Mercury linker) or if you
explicitly call `spawn' in extras/concurrency/spawn.m.

> Or does anyone have an idea how I can detect a which moment the second
> thread emerges ?

You could try building with C debugging enabled (and --high-level-code),
running your program under gdb, and setting a breakpoint on pthread_create.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list