From owner-freebsd-hackers Thu Sep 14 05:46:17 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id FAA09185 for hackers-outgoing; Thu, 14 Sep 1995 05:46:17 -0700 Received: from Relay1.Austria.EU.net (relay1.Austria.EU.net [192.92.138.47]) by freefall.freebsd.org (8.6.12/8.6.6) with SMTP id FAA09177 for ; Thu, 14 Sep 1995 05:46:12 -0700 From: marino.ladavac@aut.alcatel.at Received: from aut.alcatel.at (dnisun.aut.alcatel.at) by Relay1.Austria.EU.net with SMTP id AA20205 (5.67b/IDA-1.5 for ); Thu, 14 Sep 1995 14:45:58 +0200 Received: from atuhc16 by aut.alcatel.at (4.1/SMI-4.1/AAA-1.29/main) id AA26609; Thu, 14 Sep 95 14:45:56 +0200 Message-Id: <9509141245.AA26609@atuhc16.aut.alcatel.at> Received: by atuhc16 (1.38.193.4/16.2) id AA17916; Thu, 14 Sep 1995 14:45:49 +0200 Subject: Re: Threads,... To: julian@ref.tfs.com (Julian Elischer) Date: Thu, 14 Sep 95 14:45:49 METDST Cc: hackers@freebsd.org In-Reply-To: <199509140420.VAA02219@ref.tfs.com>; from "Julian Elischer" at Sep 13, 95 9:20 pm Mailer: Elm [revision: 70.85] Sender: hackers-owner@freebsd.org Precedence: bulk > This is the theory behinf 'rfork' > which allows the parent to decide what resources will be shared with the child. This was also the idea behind, now long deceased, VIPER kernel threads project. IMHO, Plan9 does it cleaner. > > > > > > rmillian@espuma.servtech.com (rmillian) writes: > > > > > Is FreeBSD multithreaded? If not are there plans to make it multithreaded? > > > What is someone were to try and port Java and HotJava to FreeBSD? (See > > > http:\\java.sun.com) > > > > I had a thought the other day re this and was wondering if it would work... > > > > With SYSV memory sharing, you can share memory between processes. > > A program image contains text regions and data regions. Now suppose > > you had a way of creating a shared memory region just big enough to > > hold your data image, and then mapping your data image into it. And > > your heap, if possible, (so malloc()'d data could be shared). > > > > Voila, now you can fork() a new thread... > > > > I'm not familiar with how object files are linked (relocatable data > > segments?) etc., but it *seems* like it would be easy... > > > > -Archie There is a variant of GNU malloc which uses mmap() to get the "heap." mmalloc_init (something like that) takes a file descriptor allowing the programmer to specify which file, and into which region should be mmap-ed. If several processes mmap the same file, you have shared heap. With some careful atomic locking thrown in, it should be possible to synchronize mmallocs over multiple processes. /Alby > > _______________________________________________________________________________ > > Archie L. Cobbs, archie@tribe.com * Tribe Computer Works http://www.tribe.com > >