Python and system vs process scope threads (was Re: python ports broken (sem_destroy: Resource temporarily)

Daniel Eischen eischen at vigrid.com
Fri Feb 6 15:12:03 PST 2004


A brief synopsis:

The python port uses system scope threads, or at least the
test_threaded_import.py test in /usr/local/lib/python2.3/test
does.  Is there a reason python uses system scope threads
instead of process scope threads?  It is more efficient
and consumes less resources in FreeBSD if it were to use
scope process threads.

You can use either system or process scope threads, or even
have a mix of them in FreeBSD, but I wonder if python just
defaults to system scope threads because that is what
Linux and now Solaris threads default to.

On Fri, 6 Feb 2004, Julian Elischer wrote:
> 
> On Fri, 6 Feb 2004, Daniel Eischen wrote:
> > > 
> > > Why?
> > 
> > System scope threads each have their own KSEG/KSE pair.
> > The default thread limits in the kernel are:
> > 
> >   kern.threads.max_threads_per_proc: 150
> >   kern.threads.max_groups_per_proc: 50
> > 
> > By default there are 2 KSEGs for a threaded process in
> > libpthread: one for scope process threads and one for
> > the signal handling thread.  That leaves 48 for left for
> > application use.
> > 
> > Those limits are arbitrary, so you can raise/lower them
> > if you don't like them.  I thought you came up with those
> > limits ;-)
> 
> 
> I know all that :-)
> 
> Why do they make system scope threads?
> :-)
> couldn't part of a freebsd port patch be to make them process scoe
> threads.. it'd be more efficient..
> 
> > 
> > -- 
> > Dan Eischen
> > 
> > 
> 

-- 
"Some folks are into open source, but me, I'm into open bar."
                                          -- Spencer F. Katt



More information about the freebsd-ports mailing list