From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.0 required=5.0 tests=AWL,SPF_FAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id DC52CBC69 for ; Wed, 24 Oct 2007 23:56:16 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAJNcH0fAXQImh2dsb2JhbACOWwIBCAop X-IronPort-AV: E=Sophos;i="4.21,326,1188770400"; d="scan'208";a="3612590" Received: from discorde.inria.fr ([192.93.2.38]) by mail1-smtp-roc.national.inria.fr with ESMTP; 24 Oct 2007 23:56:16 +0200 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l9OLuGHZ008279 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Wed, 24 Oct 2007 23:56:16 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAACdcH0dQW+UCh2dsb2JhbACOWwIBCAop X-IronPort-AV: E=Sophos;i="4.21,326,1188770400"; d="scan'208";a="3570846" Received: from main.gmane.org (HELO ciao.gmane.org) ([80.91.229.2]) by mail2-smtp-roc.national.inria.fr with ESMTP; 24 Oct 2007 23:56:15 +0200 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1IkoCv-0008QW-3l for caml-list@inria.fr; Wed, 24 Oct 2007 21:56:09 +0000 Received: from ks300734.kimsufi.com ([91.121.65.225]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 24 Oct 2007 21:56:09 +0000 Received: from sylvain by ks300734.kimsufi.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 24 Oct 2007 21:56:09 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: Sylvain Le Gall Subject: Re: How to monitor a specific file for changes Date: Wed, 24 Oct 2007 21:56:02 +0000 (UTC) Message-ID: References: <20071023052001.517e957e.mle+ocaml@mega-nerd.com> <471CFD24.30805@1969web.com> <20071024125457.GB12110@furbychan.cocan.org> <471F8B6B.3080306@1969web.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ks300734.kimsufi.com User-Agent: slrn/0.9.8.1pl2 (Debian) Sender: news X-Miltered: at discorde with ID 471FBF80.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; le-gall:01 2007,:98 wrote:01 wrote:01 thesis:01 rewritten:02 rewritten:02 tend:03 programming:03 programming:03 let:03 reactive:04 perhaps:05 100%:94 problem:05 Hello, On 24-10-2007, Karl Zilles wrote: > Richard Jones wrote: >> /me weeps. >> >> Please don't do this. Processes which regularly poll are a bane for >> people who are working to reduce the power consumption of laptops and >> servers. > > While your heart is in the right place, I think your priorities are > wrong on this one. They guy is writing a thesis project, not a > commercial application. > > Let him get it coded. I'm sure he's got more to worry about than saving > a few watts here and there. Or perhaps, if you feel strongly about it, > you can contribute some tested code that works on Mac OS X and linux > platforms. > I strongly disagree with your remark, it is not a save "a few watts here and there". This kind of modification can make your program 100% faster than a "poll every seconds". Moreover, knowing how to program in a "reactive" way is something that most people tend to ignore but which is really a good thing to learn (and most of the time it changes the architecture of your program). OFf course, for the sake of "quick and dirty" programming, you can just ignore everything and go directly to the easy solution... The only problem is that the "quick and dirty" initial programming that should have been rewritten, never get rewritten and you end up with something really not efficient "in production". Regards, Sylvain Le Gall