Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Sep 1996 08:00:44 +1000 (EST)
From:      John Birrell <jb@cimlogic.com.au>
To:        michaelh@cet.co.jp (Michael Hancock)
Cc:        julian@whistle.com, hsu@freefall.freebsd.org, jb@cimlogic.com.au, hackers@FreeBSD.org
Subject:   Re: libc_r bug
Message-ID:  <199609232200.IAA18261@freebsd3.cimlogic.com.au>
In-Reply-To: <Pine.SV4.3.93.960924045857.16671A-100000@parkplace.cet.co.jp> from Michael Hancock at "Sep 24, 96 05:06:03 am"

next in thread | previous in thread | raw e-mail | index | archive | help
> > > I prefer on demand too.
> > but what's the overhead on every file operation?

The same as for any blocking file op. That is, a call to _thread_fd_lock()
which calls _thread_fd_table_init(), then a call to _thread_fd_unlock().

The first call to _thread_fd_table_init() mallocs memory for the fd.
Thereafter, a non-NULL pointer is assumed to point to valid memory.

The lock/unlock operation is performed with signals blocked to ensure
that the operation is atomic wrt the process, so you need to add the
overhead of doing this twice.

> 
> Pre-allocating kind of implies fixed, but I guess it doesn't have to.  For
> 
> Maybe you can pre-allocate a chunk and dynamically allocate more chunks
> based on high water marks.
> 
> Or maybe just implement a simple algorithm first that works correctly and
> performance it would be better to pre-allocate at the expense of space.
> optimize later when you understand more aspects of the problem.

I think that it is worth spending time on making the scheduling operation
more efficient before making this sort of performance improvement. Kernel
threads would take this performance hit away.

> Mike Hancock
> 
> 

Regards,


-- 
John Birrell                                CIMlogic Pty Ltd
jb@cimlogic.com.au                          119 Cecil Street
Ph  +61  3 9690 6900                        South Melbourne Vic 3205
Fax +61  3 9690 6650                        Australia
Mob +61 18  353  137



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