This is the mail archive of the cygwin-developers 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: LoadLibrary error 487 (was Re: Please test latest developer snapshot)


On Mar  1 18:53, Corinna Vinschen wrote:
> On Mar  1 09:58, Christopher Faylor wrote:
> > On Tue, Mar 01, 2011 at 10:11:02AM +0100, Corinna Vinschen wrote:
> > >On Feb 28 23:10, Corinna Vinschen wrote:
> > >> On Feb 28 16:59, Christopher Faylor wrote:
> > >> > I have something like that sitting in my sandbox but I named the flag
> > >> > "use_dont_resolve_hack".  Actually "need_dont_resolve_hack" would
> > >> > probably be better.
> > >> > 
> > >> > But, at this point, it's nickel and dime so whatever you want to
> > >> > call it is fine.
> > >> 
> > >> "use_dont_resolve_hack" is fine with me.  If you check it in tonight,
> > >> I'll create 1.7.8 from there tomorrow morning.
> > >
> > >Talking about 1.7.9, is there perhaps a way to get rid of the multimedia
> > >timer in times.cc?  This would restrict the usage of winmm to /dev/dsp.
> > >Dumb question: Can't we just use the 64 bit uptime counter from the
> > >KUSER_SHARED_DATA area?
> > 
> > No, there really isn't.  This has already been discussed and rediscussed over
> > the years.
> 
> My brain is a bit fuzzy in terms of remembering this stuff.  Did we ever
> discussed to use a waitable timer?  This only requires ntdll functions.
> I think this is how winmm implements timeGetTime.
> 
> I made a quick test and the returned values look pretty good in
> terms of stability.  15.625 ms on XP vs. 15.6 ms on W7 without any
> weird jitter.

Or we implement timeGetTime ourselves.  Since we don't need the actual
value (msecs since system startup), we can simply use the core code of
the function.  In C it would look like this:

  DWORD
  timeGetTime_coreloop ()
  {
    LARGE_INTEGER t;

    do
      {
	t.HighPart = SharedUserData.InterruptTime.High1Time;
	t.LowPart = SharedUserData.InterruptTime.LowPart;
      }
    while (t.HighPart != SharedUserData.InterruptTime.High2Time);
    t.QuadPart /= 10000;
    return t.LowPart;
  }

The rest of the (very short) timeGetTime function just subtracts and
adds some constant values to t before returning its LowPart.

timeEndPeriod and timeBeginPeriod could be replaced with calls to
NtSetTimerResolution.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat


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