atom feed28 messages in org.freebsd.freebsd-archRe: Threads goals version III
FromSent OnAttachments
Julian ElischerOct 31, 1999 7:08 pm 
Julian ElischerOct 31, 1999 11:55 pm 
John BirrellOct 31, 1999 11:56 pm 
Michael Schuster - TSC SunOS GermanyNov 1, 1999 12:51 am 
Andrew ReillyNov 1, 1999 3:11 am 
Daniel EischenNov 1, 1999 4:26 am 
Peter DufaultNov 1, 1999 4:33 am 
Daniel EischenNov 1, 1999 4:33 am 
Randell JesupNov 1, 1999 12:28 pm 
John BirrellNov 1, 1999 1:44 pm 
Peter DufaultNov 1, 1999 1:52 pm 
Jake BurkholderNov 1, 1999 3:17 pm 
Terry LambertNov 4, 1999 10:03 am 
Peter JeremyNov 4, 1999 1:56 pm 
Daniel M. EischenNov 4, 1999 2:48 pm 
Terry LambertNov 4, 1999 2:49 pm 
Terry LambertNov 4, 1999 3:13 pm 
Amancio HastyNov 4, 1999 4:48 pm 
Russell L. CarterNov 4, 1999 5:16 pm 
Amancio HastyNov 4, 1999 6:04 pm 
Daniel M. EischenNov 4, 1999 7:04 pm 
Terry LambertNov 5, 1999 3:00 pm 
Terry LambertNov 5, 1999 3:39 pm 
Amancio HastyNov 5, 1999 4:07 pm 
Daniel C. SobralNov 6, 1999 1:01 am 
Chris CsanadyNov 6, 1999 6:23 pm 
Daniel C. SobralNov 6, 1999 11:48 pm 
Julian ElischerNov 7, 1999 2:11 am 
Subject:Re: Threads goals version III
From:Peter Dufault (dufa@hda.com)
Date:Nov 1, 1999 1:52:48 pm
List:org.freebsd.freebsd-arch

On Mon, Nov 01, 1999 at 07:33:52AM -0500, Peter Dufault wrote:

4/ All threads in a processs see the same address space (exactly).

Stacks too? Is that a rule implied from POSIX or one for portability?

I think so. There is nothing to stop a thread from passing a pointer to something on it's stack to another thread, assuming that it will ensure that the stack will remain valid. This is common practice where one thread parents one or more child threads and wishes to share information with them.

Obviously he can't return though. Here's what I would argue for in setting a standards document:

main() { int mainvar;

newthread(t1); /* t1 is a thread and it can access mainvar... */

sub(); }

sub() { int subvar;

newthread(t2); /* t2 can access subvar or mainvar, but maybe * t1 can't access subvar. * Maybe the stack just crossed a page boundary. */

while(1) keep_stack_context(); }

Essentially threads would only be guaranteed access to stack variables both in existence and valid when the thread is created. All stack growth can be in separate address spaces.

If a stackless main() creates a bunch of threads at that level and then idles those threads would have completely disjoint stacks.

Peter

To Unsubscribe: send mail to majo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message