From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 8DE5ABB9A for ; Sat, 29 Oct 2005 13:29:09 +0200 (CEST) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.173]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j9TBT9Mc027951 for ; Sat, 29 Oct 2005 13:29:09 +0200 Received: from [212.227.126.160] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1EVotT-0003KL-00; Sat, 29 Oct 2005 13:29:03 +0200 Received: from [84.58.128.165] (helo=gate.lan.gerd-stolpmann.de) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1EVotT-00054O-00; Sat, 29 Oct 2005 13:29:03 +0200 Received: from flakew.lan.gerd-stolpmann.de (flakew.lan.gerd-stolpmann.de [192.168.0.32]) by gate.lan.gerd-stolpmann.de (Postfix) with ESMTP id 227BBC053; Sat, 29 Oct 2005 13:29:03 +0200 (CEST) Subject: Re: [Caml-list] The Bytecode Interpreter... From: Gerd Stolpmann To: Jonathan Roewen Cc: Damien Doligez , caml-list@yquem.inria.fr In-Reply-To: References: <5636A978-D095-489D-A20D-8E762F133240@inria.fr> Content-Type: text/plain Date: Sat, 29 Oct 2005 13:29:02 +0200 Message-Id: <1130585342.15589.124.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.2.1.1 Content-Transfer-Encoding: 7bit X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:a6865a839c0178d9aa0ce41878507ea2 X-Miltered: at nez-perce with ID 43635D05.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 bytecode:01 gerd:01 stolpmann:01 threads:01 bytecode:01 threads:01 scheduler:01 minor:01 minor:01 heap:01 heap:01 gerd:01 caml-list:01 beginner's:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.3 Am Samstag, den 29.10.2005, 10:41 +1300 schrieb Jonathan Roewen: > Hi, > > I have a question about the vmthreads package. I've been looking at > the source of schedule.c, and am making a small understanding of how > it works. > > Is it true that this supports true pre-emption of threads (e.g. even > during a GC cycle)? No. Preemption can only happen in the main loop of the bytecode interpreter. > Also, would it be safe to build an ISR framework > that could wake up a thread waiting on an interrupt to be triggered? The problem is you need realtime behaviour. That means your ISR thread must have a higher priority than other threads, i.e. you need a realtime-aware scheduler. Second, also memory management must be realtime-aware. This is the difficult part. How to handle the case when the interrupt occurs within a GC cycle? The minor GC is not the problem, because it is very fast, and has an upper limit on the time spent in it. Major GC: In principle, you can stop it at any time. You should probably do so when the interrupt occurs. And then? The ISR must not allocate memory in this case, because the memory manager cannot give it to you in this moment (major GCs are triggered from minor GCs, so the minor heap is currently full). It is very difficult to write ISR code that does not allocate any memory. Maybe a way out is to have further minor heaps only for this purpose (one heap per realtime thread), but this raises further questions (how to get it empty again when the ISR is over? What to do if it becomes full? What to do if you still need a major heap block?) Compactification: I think this GC mode is totally incompatible with real time. You cannot stop it, and it takes a very long time. Gerd > Like if I somehow got it to act like a file descriptor... > > Jonathan > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > -- ------------------------------------------------------------ Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany gerd@gerd-stolpmann.de http://www.gerd-stolpmann.de Telefon: 06151/153855 Telefax: 06151/997714 ------------------------------------------------------------