Rafi Gordon wrote:
Hello, Thanks.
You said

If you really meant 1 microsecond (as opposed to 1 millisecond)


Yes ,I mean it. In short: it's for a video-audio app; this app can be
termed soft (or semi) real time; The terminology is not important at
all. The fact is that there are scenarios when
the timing is critical; I mean a packet that arrived at a certain time
should not be sent immediately but after some sleep interval; this
if for keeping a specified rate , which is important for a good quality. So sometimes a microsec sleep is needed, sometimes 5 or more. (Maybe it would have been better to phrase my question as sleeping in a resolution of microsecond instead of 1 microsec).

Since you mention packets and I assume you mean network I seriously doubt that your time limits are anyone near the microsecond ranges.

I might be wrong though (if you're talking about some RF packet and not Ethernet) , and if so then be aware writing this as a user space application in Linux is a no go:

Average premption latency on a x86 platform is somewhere near 10 microseconds. The worst case interrupt latency of same is < 2 microseconds but the worst case is ~40 microseconds. This is *after* all the relevant preemtive kernel patches, lock break and so on has beebn appllied. [1]

If you cannot miss a bit and you're working in sub 5 micro area and you wish to use Linux you need to use some sort of an interrupt pipline - RTAI/Adeos is my personal recomendation.

[1] A little old but gives a good view, espeically since 2.6 is worse, niot better then 2.4 + patches in this regard:

http://www.linuxforum.dk/2002/program/udstiller/montavista/slides/MontaVista_Real_Time_Linux_CPH_March2.pdf



may I ask ehat is the recommnded way to write a a busy wait loop?
If I am not wrong there is no "noop" command in "C" ; is there a noop
is asm to achieve this ? or simply a loop which just do dummy
operation
like incrementing some integer ?

arch/i386/lib/delay.c in your nearest kernel 2.6 source.

Cheers,
Gilad


--
Gilad Ben-Yossef <[EMAIL PROTECTED]>
Codefidence. A name you can trust(tm)
Web: http://codefidence.com  | SIP: [EMAIL PROTECTED]
IL: +972.9.8650475 ext. 201  | Fax:            +972.9.8850643
US: +1.360.2275194 ext. 201  | Cel:           +972.52.8260388

"I am Jack's Overwritten Stack Pointer"
        -- Hackers Club, the movie

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to