LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-02-2004, 03:53 AM   #1
frostmagic
LQ Newbie
 
Registered: Sep 2003
Posts: 28

Rep: Reputation: 15
how to do real time programs?


how do i implement it using general linux? is it possible to do it?
if possible can some one tell me how to write it?

Or must i use a rtlinux to do it?
 
Old 02-02-2004, 08:56 AM   #2
llama_meme
Member
 
Registered: Nov 2001
Location: London, England
Distribution: Gentoo, FreeBSD
Posts: 590

Rep: Reputation: 30
It totally depends on how strict your real time requirement is. If you're writing a hard real time app, an ordinary Linux kernel may not be a good choice. If you're writing a soft real time app, it could work quite well. In the end you just have to try it and see. This looks quite informative: http://www.metrowerks.com/pdf/Metrow...as_RTOS_v2.pdf

Alex
 
Old 02-02-2004, 10:20 AM   #3
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
I took a closer look at your timing schemes and since .5 second is the tightest you need you can probably handle the just fine. In fact, if you are using a linux kernel with the enhanced real time clock you could set the frequency of that and use it for timing. I am not sure exactly how that works but mplayer uses that for video timing so you can probably look at there code.

What kind of server is this? As I said before, only use timing to define a network protocol if there is absolutely no other way.
 
Old 02-02-2004, 11:42 AM   #4
frostmagic
LQ Newbie
 
Registered: Sep 2003
Posts: 28

Original Poster
Rep: Reputation: 15
I data - 13888 usecs
P data - 2777 usecs
B data - 555 usecs

tighest is .5 secs?

hmm , it a udp protocol server
i comparing the system time with the time above everytime i send
 
Old 02-02-2004, 11:53 AM   #5
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
oh duh... I don't know where I get .5 seconds from.

I am not sure what the resolution of the rtc is, but 555 usecs is pretty tight timing you could easily miss if the kernel decides it needs to do something else. If I personally had to have timing like that I would write an RTLinux kernel module. But that doesn't mean that you could possibly do it another way.

Is there something external that is dictating that timing?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
real time recompiling kris273 Programming 3 08-09-2004 11:12 PM
Real Time Equalizer st00 Linux - Software 1 03-20-2004 07:00 PM
real-time OS h/w Programming 11 01-24-2004 09:28 PM
run real time echox Programming 3 04-03-2003 03:01 PM
Real Time Plot... DaFrEQ Linux - Software 0 08-27-2002 09:25 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration