This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: cygwin on a 386?


On Wed, Oct 18, 2000 at 09:52:54PM -0500, Chris Abbey wrote:
>At 22:45 10/18/00 -0400, Christopher Faylor wrote:
>Now that I've had a minute to think about this though, let me ask you
>a better question.... WHY? What could you possibly want to put into
>cygwin that you feel it HAS to be done in asm? And that you can write
>better asm for this than gcc?

There are all sorts of places where you can get a speed advantage by
going straight to asm.  Or, there are simply some things you cannot
do in C when you are attempting to emulate an OS.

In this particular case, I'd like to avoid the overhead of a function
call when doing a relatively frequent operation (InterlockedIncrement
and InterlockedExchange).  These are basically one instruction but
the function call overhead makes this much higher -- especially on
Windows 95.  Windows 95 uses an unbelievable number of instructions to
do these relatively simple operations, thanks to the fact that it runs
on more than just Pentiums.  InterlockedExchange uses an opcode that is
available on 80486 and above (I believe) but is unavailable on 80386 and
below.

There are also place in Cygwin where it's necessary to read the frame
when adjusting things after a fork.  You can't do that with C.  We
use asm for signal handling, auto loading of DLLs, for setting
up exception handlers, and for experimental vfork emulation.

cgf

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]