9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] dial and time out
@ 2009-09-10  9:32 Mathieu L.
  2009-09-10  9:34 ` erik quanstrom
  2009-09-10  9:57 ` Sape Mullender
  0 siblings, 2 replies; 7+ messages in thread
From: Mathieu L. @ 2009-09-10  9:32 UTC (permalink / raw)
  To: 9fans

Hello 9fans,

I have a bunch of threads, simply scheduled with yield() at the moment
(I'll use alt later on), and each of them is calling dial() at some
point. I don't want the other threads to wait for "too long" when one
of them is blocked on a dial() that will eventually time out.
 So I was thinking, for each of them, of creating a proc which would
be used as a timer; it would be created just before the call to dial,
wait for some time, and then kill the dial()ing thread. And as mechiel
suggested, the dial()ing thread would also be set to kill the timer
after it successfully dialed, hence not being killed if it was fast
enough.

Is that the right way to go? If yes, can anyone think of an already
existing example I can look at?

Mathieu




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-09-10 11:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-10  9:32 [9fans] dial and time out Mathieu L.
2009-09-10  9:34 ` erik quanstrom
2009-09-10  9:51   ` Mathieu L.
2009-09-10  9:59     ` erik quanstrom
2009-09-10 10:07     ` Sape Mullender
2009-09-10  9:57 ` Sape Mullender
2009-09-10 11:26   ` Mathieu L.

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).