From owner-freebsd-hackers Fri Oct 6 10:44:51 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from Gloria.CAM.ORG (Gloria.CAM.ORG [205.151.116.34]) by hub.freebsd.org (Postfix) with ESMTP id 7B22237B503 for ; Fri, 6 Oct 2000 10:44:49 -0700 (PDT) Received: from localhost (intmktg@localhost) by Gloria.CAM.ORG (8.9.3/8.9.3) with ESMTP id NAA29225 for ; Fri, 6 Oct 2000 13:46:27 -0400 Date: Fri, 6 Oct 2000 13:46:26 -0400 (EDT) From: Marc Tardif To: freebsd-hackers@freebsd.org Subject: aio_read timeout per request Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG If I initiate multiple aio_read requests on sockets, how can I set a timeout for each request? If I call aio_waitcomplete, that sets a timeout for all. So, if I have 5 aio_reads, I would call aio_waitcomplete as many times in a loop waiting to process the first finished request. Problem with this approach is that I can end up waiting a maximum of 5*timeout for the last request to finish because aio_waitcomplete is called again with the same timeout each time. I could imagine a way this can be solved by keeping a timer and calling aio_waitcomplete with the time remaining and then, when the timer expires, call aio_return. But is there a simpler way? Is there sample code or documentation I should read on the subject? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message