This is the mail archive of the cygwin 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]
Other format: [Raw text]

Re: higher-level IO very slow with cygwin1.dll 5.10 (due to set_flags?)


On Sat, Jun 26, 2004 at 01:09:40PM -0400, Christopher Faylor wrote:
> On Sat, Jun 26, 2004 at 12:05:54PM -0400, Pierre A. Humblet wrote:
> >Beware, I found this:
> >2000-05-19  DJ Delorie  <dj@cygnus.com>
> >	* libc/include/stdio.h: no getc/putc macros for cygwin; causes
> >	compatibility issues with different dll versions
> >so you may need to recompile when updating cygwin.
> 
> Also wouldn't that work around the file locks that were ostensibly put
> there for a reason?

That crossed my mind. But there is no file lock in the macro, which is
used by systems other than cygwin. How do they manage it?
I also assume that single threaded programs don't need the lock.

I would be perfectly happy to have a thread-unsafe getc/putc macro,
and to use fgetc/fputc when I care about multithreading.

Digging deeper, I see there is a function getc_unlocked. Using it
instead of getc improves the speed by a factor 5. 
Now that I know about it, I will redefine getc to getc_unlocked when
porting single threaded applications.

That issue may be a factor in the legendary slowness of Cygwin.

Pierre

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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