Professional Web Applications Themes

sigcont - UNIX Programming

Hi, I am wondering whether the SIGCONT signal can be blocked successfully ?? Ta Pat...

  1. #1

    Default sigcont

    Hi,
    I am wondering whether the SIGCONT signal can be blocked successfully ??
    Ta
    Pat
    pat Guest

  2. #2

    Default sigcont

    Hi,
    I am wondering whether the SIGCONT signal can be blocked successfully ??
    Ta
    Pat
    pat Guest

  3. #3

    Default Re: sigcont

    pat saunders <securicor.co.uk> wrote
    in <google.com>:
    # Hi,
    # I am wondering whether the SIGCONT signal can be blocked successfully ??

    No. And it would be pointless. If a process were stopped and could not
    be continued, why keep it? You might as well kill it.

    Why do you want to ignore SIGCONT?

    Regards,

    Jens
    --
    Jens Schweikhardt http://www.schweikhardt.net/
    SIGSIG -- signature too long (core dumped)
    Jens Guest

  4. #4

    Default Re: sigcont

    No Basically it was to do with a race condition.
    A process reading from a shared queue goes to sleep if nothing is on the
    queue . A process writing to the queue , places a message on the queue and
    sends a SIGCONT to wake up sleeping process.

    process reading from queue
    -------------------------
    if nothing on queue
    sleep.

    I was worried that if above process was interrupted between
    if test and going to sleep by process writing to queue, the reading process
    would still go to sleep and miss the message, therefore I was trying to
    block SIGCONT.

    Pat




    Jens Schweikhardt <net> wrote in message news:<c15fg4$8ao$pit.comms.marconi.com>... 
    pat Guest

  5. #5

    Default Re: sigcont

    pat saunders <securicor.co.uk> wrote: 
    >>
    >> No. And it would be pointless. If a process were stopped and could not
    >> be continued, why keep it? You might as well kill it.
    >>
    >> Why do you want to ignore SIGCONT?[/ref][/ref]
     
     
     

    But that doesn't remove the race condition, you're just moving it to a
    different place - you have to unblock the signal before you go to sleep
    and when the signal comes between unblocking it and going to sleep you
    are back to square one. Since you're already seem to use shared resources
    why don't you use a semaphore, which is exactly the tool meant for these
    kinds of situations? But the other question is what do you mean by a
    "shared queue"? Isn't is something you can do a select(2) on?

    Regards, Jens
    --
    \ Jens Thoms Toerring ___ fu-berlin.de
    \__________________________ http://www.toerring.de
    Jens.Toerring@physik.fu-berlin.de Guest

  6. #6

    Default Re: sigcont

    On 24 Feb 2004 02:33:10 -0800,
    pat saunders <securicor.co.uk> wrote:

     


    You should take a look at sigsuspend() and use it with a signal other than
    SIGCONT. sigsuspend() was created for exactly this purpose.



    Villy
    Villy Guest

  7. #7

    Default Re: sigcont

    The shared queue refers to a queue in shared memory so that it is shared
    between writing and reading process. Would I be right in thinking if I replaced
    the sleep statement with a sigsuspend() . The race condition would be
    eliminated ??
    Ta
    Pat






    fu-berlin.de wrote in message news:<c1gbqi$1i6pmd$de>... [/ref]



    >
    > But that doesn't remove the race condition, you're just moving it to a
    > different place - you have to unblock the signal before you go to sleep
    > and when the signal comes between unblocking it and going to sleep you
    > are back to square one. Since you're already seem to use shared resources
    > why don't you use a semaphore, which is exactly the tool meant for these
    > kinds of situations? But the other question is what do you mean by a
    > "shared queue"? Isn't is something you can do a select(2) on?
    >
    > Regards, Jens[/ref]
    pat Guest

  8. #8

    Default Re: sigcont

    pat saunders <securicor.co.uk> wrote: 

    Yes, sigsuspend() looks like a reasonable method when you insist on
    using signals (but note, you can wait for any signal, not just SIGCONT,
    typically normal applications would use SIGUSR1 or SIGUSR2).

    Regards, Jens

    PS: Please stop top-posting - put your text _after_ what you're replying
    to (after removing all from the previous posts that isn't relevant).
    That way it's much easier to follow what's going on and is therefor
    a longstanding tradition in technical newsgroups. Thank you.
    --
    \ Jens Thoms Toerring ___ fu-berlin.de
    \__________________________ http://www.toerring.de
    Jens.Toerring@physik.fu-berlin.de Guest

  9. #9

    Default Re: sigcont

    ohout.pharmapartners.nl (Villy Kruse) wrote in message news:<ohout.pharmapartners.nl>... 
    >
    >
    > You should take a look at sigsuspend() and use it with a signal other than
    > SIGCONT. sigsuspend() was created for exactly this purpose.
    >
    >
    >
    > Villy[/ref]


    Thanks for the comments,
    I am still a bit confused. Are you saying that sigsuspend would not
    work
    with blocking SIGCONT ?? SIGUSR1 / SIGUSR2 are already in use with
    logging
    info. I am still not sure whether SIGCONT can be blocked , even for
    small
    amount of time ?? Is it queued ??
    P.S I support above code, I did not write it . It is the usual case
    for fix it now !!!
    Ta
    Pat
    pat Guest

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139