From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id UAA23838 for caml-redistribution; Wed, 1 Mar 2000 20:02:36 +0100 (MET) 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 TAA19584 for ; Wed, 1 Mar 2000 19:55:17 +0100 (MET) Received: from codex.cis.upenn.edu (CODEX.CIS.UPENN.EDU [158.130.6.15]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id TAA03176 for ; Wed, 1 Mar 2000 19:55:15 +0100 (MET) Received: (from mwh@localhost) by codex.cis.upenn.edu (8.9.3/8.9.3) id NAA29057; Wed, 1 Mar 2000 13:55:09 -0500 (EST) From: Michael Hicks Message-Id: <200003011855.NAA29057@codex.cis.upenn.edu> Subject: Re: Interpreter vs hardware threads To: maxs@in.ot.com.au (Max Skaller) Date: Wed, 1 Mar 2000 13:55:08 -0500 (EST) Cc: caml-list@inria.fr In-Reply-To: <38BC93FC.65E3ED43@in.ot.com.au> from "Max Skaller" at Mar 1, 2000 02:52:28 pm X-Mailer: ELM [version 2.4 PL23-upenn3.3] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: weis > Does anyone know how fast the ocaml bytecode interpreter > 'switches' between threads (that is, what is the scheduling overhead?) > Assume most of the threads are waiting (say, on a condition variable). > Asume LOTS of threads (thousands). > > [Hardware threads are not fast enough] Remembering back to the thread scheduler in Ocaml 2.00 (I assume it's the same one), I recall that the context switch directly relates to how many threads are waiting. This is because at each CS point, every thread is checked to see if its timeout has expired or has some I/O ready. As a result, performance degrades sharply as you add more threads. With a small number of threads (around 10) on a Pentium II 300 MHz machine, we measured the context switch time to be about 100 microsecs. See our INFOCOM 99 paper for more info on the system we were measuring this in (our active network, PLANet): http://www.cis.upenn.edu/~switchware/papers/infocom99-plan.ps. Mike -- Michael Hicks Ph.D. Candidate, the University of Pennsylvania http://www.cis.upenn.edu/~mwh mailto://mwh@dsl.cis.upenn.edu "The pessimist sees difficulty in every opportunity. The optimist sees the opportunity in every difficulty." -- Winston Churchill