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 KAA19502; Thu, 29 Jan 2004 10:56:41 +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 KAA19264 for ; Thu, 29 Jan 2004 10:56:40 +0100 (MET) Received: from alex.baretta.com ([213.255.109.130]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id i0T9udP09274 for ; Thu, 29 Jan 2004 10:56:39 +0100 (MET) Received: from baretta.com (localhost.localdomain [127.0.0.1]) by alex.baretta.com (8.12.8/8.12.8) with ESMTP id i0T9uoWu003149; Thu, 29 Jan 2004 10:56:51 +0100 Message-ID: <4018D8E2.2060205@baretta.com> Date: Thu, 29 Jan 2004 10:56:50 +0100 From: Alex Baretta User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 To: james woodyatt , Ocaml Subject: Re: [Caml-list] ocaml and concurrency References: <20040127063230.GA12482@inv_machine> <200401282326.i0SNQntl004612@bismarck-chet.watson.ibm.com> <97908806-5238-11D8-8975-000393B8133A@wetware.com> In-Reply-To: <97908806-5238-11D8-8975-000393B8133A@wetware.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Loop: caml-list@inria.fr X-Spam: no; 0.00; baretta:01 baretta:01 caml-list:01 woodyatt:01 chet:01 murthy:01 convincing:01 threads:01 higher-order:01 non-blocking:01 passing:01 monolithic:01 abstractions:01 threads:01 jet:99 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk james woodyatt wrote: > On 28 Jan 2004, at 15:26, Chet Murthy wrote: > > I've almost finished convincing myself that > the multi-threaded programming environment itself > should be considered harmful and wrong and Just Say No, Kids. > > But to write concurrent services without threads, you have to use a lot > of higher-order functions and non-blocking I/O functions. Hey, guess > what? Ocaml is a pretty good language for mixing functional programming > with imperative programming. What if the *right* way to get concurrency > really *is* the ancient Unix dogma of 1) use heavyweight process > switching and message passing between processes, and 2) use monolithic > event loops inside lightweight programs? > > I'm still working on a demonstration of the concept. Please mind the gap. Of course you are free to use the lower level abstractions if you like them better, but it gives you no more safety than threads. It's like flying your own jet plane because you are suspicious of pilots. Well, are you not a pilot if you fly your own plane? And are not reimplementing a (limited) multithreading model when you use Unix.select to choose a descriptor ready for IO? Concurrency is neither good nor bad: it's just a part of modern interactive information systems. You've got to cope with it. It takes competence and adequate tools. I beleive that the message passing model implemented in the threads library's Event module is great abstraction with which to cope with the intricacies of concurrency. If this library had support for marshalling events through channels with an underlying file descriptor, Event would give me all the facilities I need for concurrency and distributed parallel processing. Yet the neither the solution nor the problem are ever in the tool, but in the tool's user. You can implement distributed concurrent applications with Unix.select. Or, if you cannot trust the real-tiime capabilities of your Unix kernel, you can always code your own kernel--this is what a number of companies actually do (i.e. Cisco, with its proprietary OS) but whether their systems are more or less trustworthy than a Linux or BSD box is doubtful. Alex ------------------- 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