From owner-p4-projects Fri May 3 9:41:26 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CE7DC37B4BF; Fri, 3 May 2002 09:41:14 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mail.speakeasy.net (mail11.speakeasy.net [216.254.0.211]) by hub.freebsd.org (Postfix) with ESMTP id 0661A37B42B for ; Fri, 3 May 2002 09:40:47 -0700 (PDT) Received: (qmail 11323 invoked from network); 3 May 2002 16:40:46 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail11.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 3 May 2002 16:40:46 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.11.6/8.11.6) with ESMTP id g43GeiF12105; Fri, 3 May 2002 12:40:44 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20020503085009.C81190@stylus.haikugeek.com> Date: Fri, 03 May 2002 12:40:38 -0400 (EDT) From: John Baldwin To: Jonathan Mini Subject: Re: PERFORCE change 10740 for review Cc: Perforce Change Reviews Cc: Perforce Change Reviews , Julian Elischer Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 <>< 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