Re: Threading system calls (int 80h)

2006-10-21 Thread Ekkehard Morgenstern
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 exter

Re: Threading system calls (int 80h)

2006-10-21 Thread Ekkehard Morgenstern
On Monday 16 October 2006 01:12, David Xu wrote: > > How do I use THR syscalls? > > Yes, you can use THR syscalls, they are more simple. > you can use thr_new to create a thread, and use thr_exit to exit > a thread. > You can learn how to use them by reading some code in libthr, > note, this interf

Re: Threading system calls (int 80h)

2006-10-20 Thread John-Mark Gurney
David Xu wrote this message on Tue, Oct 17, 2006 at 17:17 +0800: > work in the past. Also rfork() does not allow you to specify user stack, you > have to add some tricky code to make it safe before new > thread really can do real work, [...] That's why you use rfork_thread(3)... -- John-Mark G

Re: Threading system calls (int 80h)

2006-10-17 Thread David Xu
On Tuesday 17 October 2006 16:10, Divacky Roman wrote: > On Mon, Oct 16, 2006 at 02:08:59PM +0200, Marco van de Voort wrote: > > > On Sunday 15 October 2006 01:32, David Xu wrote: > > > > You are going to be unable to use libc if you create raw thread in > > > > your program, libc uses pthread APIs

Re: Threading system calls (int 80h)

2006-10-17 Thread Divacky Roman
On Mon, Oct 16, 2006 at 02:08:59PM +0200, Marco van de Voort wrote: > > > > On Sunday 15 October 2006 01:32, David Xu wrote: > > > You are going to be unable to use libc if you create raw thread in your > > > program, libc uses pthread APIs, if you create a raw thread, your > > > program will cras

Re: Threading system calls (int 80h)

2006-10-16 Thread Marco van de Voort
> > On Sunday 15 October 2006 01:32, David Xu wrote: > > You are going to be unable to use libc if you create raw thread in your > > program, libc uses pthread APIs, if you create a raw thread, your > > program will crash if you use any libc function which needs pthread > > interface. > > I don't

Re: Threading system calls (int 80h)

2006-10-15 Thread David Xu
On Sunday 15 October 2006 16:11, Ekkehard Morgenstern wrote: > On Sunday 15 October 2006 03:31, David Xu wrote: > > You can use KSE syscalls or THR syscalls, for KSE syscalls you > > should use bound thread, otherwise you have to support > > UPCALLS and other complex things. > > How do I use THR sy

Re: Threading system calls (int 80h)

2006-10-15 Thread Ekkehard Morgenstern
On Sunday 15 October 2006 03:31, David Xu wrote: > You can use KSE syscalls or THR syscalls, for KSE syscalls you > should use bound thread, otherwise you have to support > UPCALLS and other complex things. How do I use THR syscalls? ___ freebsd-hackers@

Re: Threading system calls (int 80h)

2006-10-14 Thread David Xu
On Sunday 15 October 2006 09:26, Ekkehard Morgenstern wrote: > On Sunday 15 October 2006 01:32, David Xu wrote: > > You are going to be unable to use libc if you create raw thread in your > > program, libc uses pthread APIs, if you create a raw thread, your > > program will crash if you use any lib

Re: Threading system calls (int 80h)

2006-10-14 Thread Ekkehard Morgenstern
On Sunday 15 October 2006 01:32, David Xu wrote: > You are going to be unable to use libc if you create raw thread in your > program, libc uses pthread APIs, if you create a raw thread, your > program will crash if you use any libc function which needs pthread > interface. I don't want to link to

Re: Threading system calls (int 80h)

2006-10-14 Thread David Xu
On Saturday 14 October 2006 21:40, Ekkehard Morgenstern wrote: > Hi! > > Does anyone know how to use the threading system calls that are accessible > via int 80h? > > I would like to support multithreading in an assembly language program > without linking to any of the threading libraries. > > Is t

Re: Threading system calls (int 80h)

2006-10-14 Thread Ekkehard Morgenstern
I can answer the question myself now: - manpages of interest are kse(2) and ucontext(3) - FreeBSD threading relies on external threading libraries, such as libthr, libpthread. - hence, it's difficult to impossible to write an assembly language program t

Threading system calls (int 80h)

2006-10-14 Thread Ekkehard Morgenstern
Hi! Does anyone know how to use the threading system calls that are accessible via int 80h? I would like to support multithreading in an assembly language program without linking to any of the threading libraries. Is that possible? Best wishes, Ekkehard.