From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA10430; Thu, 8 Jul 2004 09:51:10 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id JAA10142 for ; Thu, 8 Jul 2004 09:51:09 +0200 (MET DST) Received: from postfix3-1.free.fr (postfix3-1.free.fr [213.228.0.44]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i687p8EV012646 for ; Thu, 8 Jul 2004 09:51:08 +0200 Received: from univ-savoie.fr (grenoble-2-62-147-58-90.dial.proxad.net [62.147.58.90]) by postfix3-1.free.fr (Postfix) with ESMTP id 2116B1736A4; Thu, 8 Jul 2004 09:51:07 +0200 (CEST) Message-ID: <40ED5144.8050903@univ-savoie.fr> Date: Thu, 08 Jul 2004 09:51:00 -0400 From: Christophe Raffalli User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040115 X-Accept-Language: en-us, en MIME-Version: 1.0 Cc: caml-list Subject: Re: [Caml-list] Thread and kernel 2.6 pb still there in CVS References: <20040624194603.2A91010EF06@clark.cs.brown.edu> <1088158825.1941.113.camel@pelican.wigram> <20040625110748.GB2707@bourg.inria.fr> <1088166608.1941.120.camel@pelican.wigram> <40DC38D3.4010009@univ-savoie.fr> <20040628150805.GC7353@yquem.inria.fr> <40E0D34C.2040808@univ-savoie.fr> <7AFB5F64-C944-11D8-975C-00039310CAE8@inria.fr> <40E11621.3050709@univ-savoie.fr> <40E97058.5060503@univ-savoie.fr> <20040705163421.GA12344@yquem.inria.fr> <40EA71ED.9040005@baretta.com> In-Reply-To: <40EA71ED.9040005@baretta.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Miltered: at nez-perce with ID 40ECFCEC.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; raffalli:01 raffalli:01 univ-savoie:01 caml-list:01 systhreads:01 posix:01 struct:01 sched:01 val:01 savoie:01 chablais:01 73376:01 univ-savoie:01 lama:01 enigmail:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I did again some testing, with a Caml program with 2 thread, one doing only float computation for a long time with no allocation. The nanosleep suggestion seems much better than the actual version doing nothing: This gives the following code in systhreads/posix.c: /* Allow re-scheduling */ value caml_thread_yield(value unit) /* ML */ { struct timespec timer = { 0, 1 }; enter_blocking_section(); nanosleep (&timer, NULL); /* sched_yield();*/ leave_blocking_section(); return Val_unit; } -- Christophe Raffalli Université de Savoie Batiment Le Chablais, bureau 21 73376 Le Bourget-du-Lac Cedex tél: (33) 4 79 75 81 03 fax: (33) 4 79 75 87 42 mail: Christophe.Raffalli@univ-savoie.fr www: http://www.lama.univ-savoie.fr/~RAFFALLI --------------------------------------------- IMPORTANT: this mail is signed using PGP/MIME At least Enigmail/Mozilla, mutt or evolution can check this signature --------------------------------------------- ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners