Re: select or signal - which one to choose?

From: Joe Beanfish (joebeanfish_at_nospam.duh)
Date: 08/09/04

  • Next message: William Ahern: "Re: select or signal - which one to choose?"
    Date: Mon, 09 Aug 2004 13:29:51 -0400
    
    

    On Mon, 09 Aug 2004 10:22:55 +0400, Igor Gorbounov <igorbounov@topazelectro.ru> wrote:

    > **** Post for FREE via your newsreader at post.usenet.com ****
    >
    > Joe Beanfish wrote:
    > > [...]
    > >
    > > Since you're already using select I'd be inclined to use that for
    > > the serial portion too. Should be much simpler than trying to
    > > have both methods.
    > There is an unpleasant problem: for polling comport I need a timeout
    > (about 20 mc in case some of the controllers would fail, then the
    > app has to call the other controller in queue), but in a listening
    > clients request module there is an infinite timeout (NULL timeout
    > in select's last parameter). So I have to use 2 selects to solve
    > the task.

    Why? Use one select with timeout for both. If the timeout
    occurs adjust your queue and restart the select, which you're
    going to do anyhow, otherwise handle the ready channel(s).


  • Next message: William Ahern: "Re: select or signal - which one to choose?"

    Relevant Pages

    • Re: Will python ever have signalhandlers in threads?
      ... explains why Python requires so little of platform ... >> I don't fault the current Queue implementation. ... >> threads ask for the lock continuosly while the timeout threads only ... >> ask for the lock periodically. ...
      (comp.lang.python)
    • Re: WaitForSingleObject freezes application
      ... Use MsgWaitForMultipleObjectsEx/MWMO_INPUTAVAILABLE get around that unread ... >>If you need wait on object in UI thread, MsgWaitForMultipleObjects can be ... Everytime you resume waiting, timeout is reset, so ... > function to check the queue. ...
      (microsoft.public.vc.mfc)
    • Re: sending email in .Net
      ... You can increase the timeout, so that the page has time to complete. ... Juan T. Llibre ... the message in a message queue to be processed by EmailAgent. ... Dim P, U, Em As String ...
      (microsoft.public.dotnet.framework.aspnet)
    • Re: SMTP Server Remote Queue Length Alert
      ... As long as they aren't being delivered, you can either flush them manually or just let them timeout. ... I was thinking about the problem as I drove home, and I remembered that among the 4,000 messages in the queue this morning were two unconnected legitimate outgoing messages, which were stuck in the queue before I disabled outbound SMTP mail. ... I'm trying an experiment this evening - I've sent a message to my work e-mail, and two other e-mail addresses I control, all in the To: ...
      (microsoft.public.exchange.admin)
    • Re: Will python ever have signalhandlers in threads?
      ... >> a timeout is specified but goes in a loop sleeping and periodically ... nor even that the platform have a SIGALRM signal. ... >It's possible to build a better Queue implementation that runs only on ... So what do you think about a lock timeout. ...
      (comp.lang.python)