From: pavenis AT lanet DOT lv To: sandmann AT clio DOT rice DOT edu (Charles Sandmann), djgpp-workers AT delorie DOT com, pavenis AT lanet DOT lv Date: Tue, 14 Aug 2001 19:05:21 +0300 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: Selector Exhaustion Message-ID: <3B797671.5443.399C9F@localhost> In-reply-to: <10108141456.AA13336@clio.rice.edu> References: <3B790835 DOT 21623 DOT 13164B AT localhost> from "pavenis AT lanet DOT lv" at Aug 14, 2001 11:15:01 AM X-mailer: Pegasus Mail for Win32 (v3.12c) Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On 14 Aug 2001, at 9:56, Charles Sandmann wrote: > > Initially I did some timing: > > checking all descriptors once took about 1 ms on PIII-700 (Win98SE) > > This worries me a bit - this means about 1/4 of second on the 386/16 > type platform for the two checks around a call. This could add hours > to a build on slower machines. I tested that both descriptor scans is taking up to 20% of time needed to call a very simple program that does nothing except one printf (output of selectors it's using) and fits in disk cache. I think than in real programs the the difference will be bigger. I tested that on PIII 700 (about 2ms to scan descriptors twice and 10 ms to run a executable) and on a slow 486DX2 66 (about 15ms and 170 ms). > I was hoping to be smarter about the area scanned. For example, > allocate 1 selector to get a starting point, then scan 50 selectors > above that point (cut time by factor of 400). We might consider > in-lining the lar call or making a new routine to do a bulk check? Tried to put LAR into loop (inline assembler) and got time down from 1 ms to about 0.75 ms > We also can't hard code selectors (like 7 as the start in the example) > since this is bad under non-ring-3 DPMI providers. Perhaps we could use _my_ds() % 7 as start value > Your example looks very much like what I was working on last night :-) We can also allocate 2 descriptors before and after spawning executable and free all between that was free before spawning (it's more safe as doing it blindly) Andris