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 JAA14949; Thu, 29 Jan 2004 09:53:26 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id JAA15048 for ; Thu, 29 Jan 2004 09:53:25 +0100 (MET) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from wetware.com (wetware.wetware.com [199.108.16.1]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id i0T8rOP28839 for ; Thu, 29 Jan 2004 09:53:24 +0100 (MET) Received: from [208.177.152.18] (helo=[10.0.1.7]) by wetware.com with esmtp (Exim 4.20) id 1Am7vP-0002wb-ED for caml-list@inria.fr; Thu, 29 Jan 2004 00:53:23 -0800 Mime-Version: 1.0 (Apple Message framework v612) In-Reply-To: <200401282326.i0SNQntl004612@bismarck-chet.watson.ibm.com> References: <20040127063230.GA12482@inv_machine> <200401282326.i0SNQntl004612@bismarck-chet.watson.ibm.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Message-Id: <97908806-5238-11D8-8975-000393B8133A@wetware.com> Content-Transfer-Encoding: quoted-printable From: james woodyatt Subject: [Caml-list] ocaml and concurrency Date: Thu, 29 Jan 2004 00:53:22 -0800 To: The Trade X-Mailer: Apple Mail (2.612) X-Loop: caml-list@inria.fr X-Spam: no; 0.00; woodyatt:01 jhw:01 wetware:01 chet:01 murthy:01 threads:01 threads:01 bug:01 bug:01 onsite:99 bug':01 bug':01 convincing:01 runtime:01 avoided:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On 28 Jan 2004, at 15:26, Chet Murthy wrote: > > [...] > "concurrency"! You ever tried to use Java threads to do anything > meaningful? Check out the J2EE spec. It basically is BUILT around > NOT sharing anything between threads. > > Oh, and y'know, we have a joke: "every Java bug is a connection-pool > (or resource-pool) bug". > > Here's another: "When you arrive onsite, grep for synchronized, and > if you see it, put your laptop back in your bag, tell 'em you're going > to get coffee, and don't come back". > [...] In my current day job, I get paid to code on an application for the=20 VxWorks RTOS, a very multi-threaded environment. I've been around=20 multi-threaded programming environments for a long time now. Since the=20= late 1980's anyway. That's no joke about 'every bug being a=20 resource-pool bug'-- except in C/C++ (as well as Java probably), there=20= are also the other two kinds of bug: the 'unprotected critical section=20= bug' and the 'mutual exclusion deadlock bug'. I've almost finished convincing myself that the main problem with the=20 Java Runtime Environment (which I don't have much experience with,=20 because I saw it as a train wreck waiting to happen back when the world=20= was all jazzed to be getting Java 1.0 someday soon, and I avoided it at=20= all costs) is that the multi-threaded programming environment itself=20 should be considered harmful and wrong and Just Say No, Kids. But to write concurrent services=A0without threads, you have to use a = lot=20 of higher-order functions and non-blocking I/O functions. Hey, guess=20 what? Ocaml is a pretty good language for mixing functional=20 programming with imperative programming. What if the *right* way to=20 get concurrency really *is* the ancient Unix dogma of 1) use=20 heavyweight process switching and message passing between processes,=20 and 2) use monolithic event loops inside lightweight programs? I'm still working on a demonstration of the concept. Please mind the=20 gap. --=20 j h woodyatt markets are only free to the people who own them.= ------------------- 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