Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S266333AbUJNPtR (ORCPT ); Thu, 14 Oct 2004 11:49:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S266236AbUJNPtR (ORCPT ); Thu, 14 Oct 2004 11:49:17 -0400 Received: from chaos.analogic.com ([204.178.40.224]:3712 "EHLO chaos.analogic.com") by vger.kernel.org with ESMTP id S266333AbUJNPtO (ORCPT ); Thu, 14 Oct 2004 11:49:14 -0400 Date: Thu, 14 Oct 2004 11:49:05 -0400 (EDT) From: "Richard B. Johnson" Reply-To: root@chaos.analogic.com To: Davide Rossetti cc: Martijn Sipkema , linux-kernel@vger.kernel.org Subject: Re: waiting on a condition In-Reply-To: <416E9D1E.8090203@roma1.infn.it> Message-ID: References: <02bb01c4b138$8a786f10$161b14ac@boromir> <416D49FF.10003@radiantdata.com> <1097701123.4648.13.camel@localhost.localdomain> <416E9D1E.8090203@roma1.infn.it> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1272 Lines: 50 On Thu, 14 Oct 2004, Davide Rossetti wrote: > Martijn Sipkema wrote: > > >On Wed, 2004-10-13 at 17:30, Peter W. Morreale wrote: > > > > > >>Have you looked at the wait_event() family yet? Adapting that > >>methodolgy might > >>suit your needs. > >> > >> > > > >wait_event() seems to be what I was looking for; I don't really like the > >condition being an argument. > > > > > > > you may have a look at http://lwn.net/Articles/22913/ > it's interesting :) > regards You could always do: while(whatever) { set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(0); if(signal_pending(current)) break; // Or do something else } set_current_state(TASK_RUNNING); // Probably redundant You could also set a specific HZ for the timeout, and count them for a "never happened" timeout. Cheers, Dick Johnson Penguin : Linux version 2.4.26 on an i686 machine (5570.56 BogoMips). Note 96.31% of all statistics are fiction. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/