Antw: Re: [linux-audio-dev] Big Qthread vs. pthread and usleepproblem

Ivica Bukvic ico at fuse.net
Fri Nov 30 22:33:22 GMT 2001


First off, thank you for your reply, but I am not completely sure as to
what are you referring to with #define HZ? Is this some kind of a global
variable that I put in my code, or are you talking about recompiling the
kernel with this value?

Other options are not feasible since I want my app to run comfortably on
an unaltered kernel, so that other users can easily use it.

Ivica Ico Bukvic, composer, audio sculptor,
programmer & computer consultant
http://meowing.ccm.uc.edu/~ico/
ico at fuse.net
============================
"To be is to do"   - Socrates
"To do is to be"   - Sartre
"Do be do be do"   - Sinatra
"I am"             - God

> -----Original Message-----
> From: Mailing list agent [mailto:mdom at barney.cs.uni-potsdam.de] On
Behalf
> Of Andreas DUNKE
> Sent: Friday, November 30, 2001 4:55 AM
> To: kdevelop at kdevelop.org
> Subject: Antw: Re: [linux-audio-dev] Big Qthread vs. pthread and
> usleepproblem
> 
> Hi!
> 
> MfG,
> Andreas Dunke
> 
> 
> >>> Paul Davis <pbd at Op.Net> 30.11.2001  00.29 Uhr >>>
> 
> >>2) I am using pthread_create right now (everything works), but since
the
> >>loop within the thread is infinite, it poses as a serious resource
hog.
> >>So, what I decided to do is to add usleep(10000) value which would
give
> >>me 10ms sleep "sessions" in between the counting, since my timer
only
> 
> >You can't "just sleep" for less than 20ms. The system timer has that
> >resolution (at least, by default on x86; its different on other
> >architectures and it can be changed at kernel compile time), and it
is
> >what is used to wakeup processes that call sleep/usleep/nanosleep.
see
> >below for more.
> 
> Some weeks ago I had the same problem (usleep() can not sleep less
than
> 20ms on a x86).
> To change this, you have some posibilities:
> 1) Change the #define HZ to a higher value. With a Kernel 2.4 it can
not
> be greater than 1536 (I don't no why). With Kernel 2.2 yout can set it
> higher. With this change you can sleep for about 1 ms.
> 2) In the web I found a low-latancy patch for the kernel, wich do some
> changes in the kernel to solve the 'problem'
> 3) You can use KURT. It is change the kernel in that way, that you
have a
> realtime kernel. http://www.ittc.ku.edu/kurt/
> 
> 
> 
> 
> 
> 
> -
> to unsubscribe from this list send an email to kdevelop-
> request at kdevelop.org with the following body:
> unsubscribe >your-email-address<



-
to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop mailing list