[662] in Pthreads mailing list archive

home help back first fref pref prev next nref lref last post

[Q] Timeout a thread

daemon@ATHENA.MIT.EDU (monty@tcx.se)
Mon Jun 2 14:41:09 1997

Date: Mon, 2 Jun 1997 21:26:58 +0300 (EET DST)
From: <monty@tcx.se>
Reply-To: monty@analytikerna.se
To: pthreads@MIT.EDU
In-Reply-To: <Pine.SOL.3.95.970602112739.7902A-100000@perot.snare.com>

>>>>> "Chi" == Chi  <chi@perot.snare.com> writes:

Chi> Hi folk,
Chi>         I create a thread doing synchronous connect().  Is there any handy
Chi> thread functions to timeout/terminate if connect() takes too long?
Chi> Thanks in advance!

You can set up a alarm around the connect. It's a little tricky to do
this with threads, but you can look at the code in MySQL, mysys/thr_alarm.c
from http://www.tcx.se how to do this.

Monty




home help back first fref pref prev next nref lref last post