[154] in Pthreads mailing list archive

home help back first fref pref prev next nref lref last post

Re: fd tablesize in beta4_1

daemon@ATHENA.MIT.EDU (Owen Rees)
Wed Oct 25 14:14:37 1995

To: Nils Jungclaus <nils@TechFak.Uni-Bielefeld.DE>
Cc: pthreads@MIT.EDU
In-Reply-To: Message from nils@TechFak.Uni-Bielefeld.DE of Wed, 25 Oct 
 1995 14:59:38 +0100.
             <9510251359.AA01386@minkus.TechFak.Uni-Bielefeld.DE> 
Date: Wed, 25 Oct 1995 17:41:38 +0000
From: Owen Rees <rtor@ansa.co.uk>

Nils Jungclaus <nils@TechFak.Uni-Bielefeld.DE> writes:
> Hi!
> 
> Trying the new beta4_1 release I still have some errors using
> rpc with the thread lib. As I posted some time ago, the
> fd-table allocated in pthread/fd.c is too small and I get
> a segmentation fault when accessing fd[42]. The following patch
> for pthread/fd.c fixes this. On Sun4 and Linux at least rpc runs
> fine with threads now.
> 
> 
> 62c62
> < static const int dtablecount = 4096/sizeof(struct fd_table_entry);
> ---
> > static const int dtablecount = 32768/sizeof(struct fd_table_entry);

The problem arises when the number of file descriptors select is told 
to watch exceeds the number that have been used. A different solution 
was sent to the pthreads-bugs list recently, see
<URL:http://www.mit.edu:8008/charon.mit.edu/pthreads-bugs/27>

Since nothing can be happening on fd's that have never been used, 
stopping where the allocation runs out seems the right thing to do. The 
only thing to check is that there is nothing that will go beyond that 
allocation later in 'select'.

Owen Rees
 <rtor@ansa.co.uk>, <URL:http://www.ansa.co.uk/Staff/rtor.html>
 Information about ANSA is at <URL:http://www.ansa.co.uk/>.



home help back first fref pref prev next nref lref last post