Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Oct 2006 23:27:13 +0200
From:      Ekkehard Morgenstern <ekkehard.morgenstern@onlinehome.de>
To:        John-Mark Gurney <gurney_j@resnet.uoregon.edu>
Cc:        freebsd-hackers@freebsd.org, Divacky Roman <xdivac02@stud.fit.vutbr.cz>, David Xu <davidxu@freebsd.org>
Subject:   Re: Threading system calls (int 80h)
Message-ID:  <200610212327.13790.ekkehard.morgenstern@onlinehome.de>
In-Reply-To: <20061020212457.GQ23971@funkthat.com>
References:  <200610150326.03279.ekkehard.morgenstern@onlinehome.de> <200610171717.30834.davidxu@freebsd.org> <20061020212457.GQ23971@funkthat.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday 20 October 2006 23:24, John-Mark Gurney wrote:
> That's why you use rfork_thread(3)...

Thanks! That really helps! :-)

What I'm trying to do is to write a virtual machine in assembly language on 
FreeBSD that can be run right after the kernel has been loaded. I would like 
to avoid external library dependencies, so, for threading, I need some 
mechanism to make it possible with kernel calls only.

I'll be looking at the THR calls as well, but it helps my confidence that 
rfork(2) and rfork_thread(3) are documented.

I'm not sure if I understood the FreeBSD threading mechanism correctly. Are 
threads always processes? Then it would make no difference if I fork instead 
of using specific threading calls. I would like to enable the users of my VM 
to take advantage of multiple CPUs, so a process-based solution doesn't look 
so bad.

How much overhead is involved in FreeBSD multitasking? 
I will probably also implement a virtual threading mechanism, because every VM 
process or thread can also multiplex instruction streams scheduled to run 
concurrently, at least as long as they're interpreted and not converted to 
native code yet. When the number of virtual threads exceeds a configurable 
limit, a real thread or process can be created that can run further virtual 
threads.

Does anyone of you have any further recommendations or advice? I would like to 
pick a solution that can perform optimally on FreeBSD.

- Ekkehard.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200610212327.13790.ekkehard.morgenstern>