Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 03 May 2002 12:40:38 -0400 (EDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Jonathan Mini <mini@freebsd.org>
Cc:        Perforce Change Reviews <perforce@freebsd.org>, Julian Elischer <julian@elischer.org>
Subject:   Re: PERFORCE change 10740 for review
Message-ID:  <XFMail.20020503124038.jhb@FreeBSD.org>
In-Reply-To: <20020503085009.C81190@stylus.haikugeek.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On 03-May-2002 Jonathan Mini wrote:
> Julian Elischer [julian@elischer.org] wrote :
> 
>> On Fri, 3 May 2002, Jonathan Mini wrote:
>> 
>> > http://people.freebsd.org/~peter/p4db/chv.cgi?CH=10740
>> > 
>> > Change 10740 by mini@mini_stylus on 2002/05/03 07:51:09
>> > 
>> >    - Change thread_get(void) -> thread_alloc(void) to keep from
>> >      conflicting with thread_get(struct proc *) in sys/kerne/kern_proc.c.
>> 
>> but, but but... the thread_get() in kern_proc.c is a standin for the 
>> one in kern_thread.c whe there is no kern_thread.c
>> 
>> they are supposed to be the same function.. teh one in kern_proc.c
>> is removed when kse is added.....
>> 
>> I called it thread_get rather than thread_alloc because
>> it caches them and doesn always need to allocate a new one....
> 
> Oho! Well, then. =)
> I see what was going on now.
> I misread the code and though that p_xxthread was a pointer. =)
> 
> I can change the code back, no problem, but I still feel that thread_alloc()
> is a more appropriate name (caching allocators are really quite common).
> Also, after some discussion between me and jhb on #bsdcode, it became
> clear that we'd want a struct thread ctor/dtor pair that'd help with
> things like fork and exit. His suggestion was a thread_alloc()/thread_exit()
> pair. I haven't really looked into it in detail, so I'm not sure yet.

Well, thread_create/thread_destroy(), but thread_exit() might be more
appropriate for when a thread wants to exit, then it gets destroyed via
thread_destroy() later.

> Hmm. Why would you allocate a thread from within msleep()?

You need a new thread to do the upcall back into the userland scheduler when
the current thread blocks before your quantum is up.

-- 

John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20020503124038.jhb>