To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cadOpen lugnet.cad in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / 14533
14532  |  14534
Subject: 
Re: how does a line ends?
Newsgroups: 
lugnet.cad
Date: 
Sat, 7 Apr 2007 22:59:06 GMT
Viewed: 
1760 times
  
In lugnet.cad, Ross Crawford wrote:
   Google to the rescue.

Thanks, ROSCO. I took that code and modified it to use char instead of _TCHAR, and got timings of 720-750ms, compared to the 750-780ms I got with my original one. I then modified it to support CR and LF interchangeably, and got back to the 750-780ms timings from my original code. So it seems safe to say that the actual MS fgets function is done differently. (The one you posted is for _TCHAR, which is two bytes when UNICODE is defined, and one byte when UNICODE isn’t defined.)

Note that all of my timings have been done in release mode with optimizations enabled. I’m not going to post any of these test routines due to the fact that I’m unsure about the copyright restrictions. Sure the MS code is public, but it doesn’t say to feel free to copy it.

--Travis



Message has 2 Replies:
  Re: how does a line ends?
 
(...) Interesting. I looked at the C runtime library sources that came with MSVC++ 6.0. The fgets() function there is definitely a little different than either yours or the one ROSCO linked. It does have a couple calls for thread safety, but (...) (17 years ago, 7-Apr-07, to lugnet.cad, FTX)
  Re: how does a line ends?
 
(...) Now that I'm at work, I'm able to look at Microsoft's implementation of fgets for Visual Studio 2005. They do a lock on the file prior to their loop, then call _fgetc_nolock to get each character, instead of fgetc or fread. (That's an (...) (17 years ago, 9-Apr-07, to lugnet.cad, FTX)

Message is in Reply To:
  Re: how does a line ends?
 
(...) (URL) Google to the rescue>. ROSCO (17 years ago, 7-Apr-07, to lugnet.cad, FTX)

24 Messages in This Thread:











Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR