LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 07-29-2003, 07:47 AM   #1
svsvenu
LQ Newbie
 
Registered: Jul 2003
Location: lexington kentucy
Distribution: red hat
Posts: 5

Rep: Reputation: 0
problem using sched_fifo


problem using sched_fifo ( post #1)

members,

I have been tryin to use sched_fifo command, I have created two processes(using fork) and assigned priorities to them using sched_fifo scheduler. and setparam function. The program itself has to print a's in one process and b's in another. I have created a delay in printing using a dummy for loop. the expected output is
a <delay> a ........
but what its actually doing is throwing out all the output atonce.
I did make the delay large enough for it to take considerable amount of time. I have a feeling that the processes are taking up higher priority as compared to the shell itself.

Please help with some debugging

Thanks

venu
 
Old 07-29-2003, 07:59 AM   #2
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 51
how are you outputting? if its with some sort of buffered output system like printf then it wont display until the buffer is full or you explicity flush the buffer. if your using printf then the buffer can be flushed by fflush(stdout);
 
Old 07-29-2003, 08:00 AM   #3
DIYLinux
Member
 
Registered: Jul 2003
Location: NL
Distribution: My own
Posts: 92

Rep: Reputation: 18
Using stdio ? Beware of buffering. Either turn buffering off on stdout, use stderr or use low level write.

Using C++ iostream; like wise.
 
Old 07-29-2003, 08:09 AM   #4
svsvenu
LQ Newbie
 
Registered: Jul 2003
Location: lexington kentucy
Distribution: red hat
Posts: 5

Original Poster
Rep: Reputation: 0
I have been using fprint(stderr,......)
doesent seem to work

venu
 
  


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
perl problem? apache problem? cgi problem? WorldBuilder Linux - Software 1 09-17-2003 07:45 PM
SCHED_FIFO not working with g++ but gcc ?! DocBexter Programming 0 09-09-2003 12:57 PM
problem using sched_fifo svsvenu Linux - Newbie 0 07-29-2003 07:37 AM
running pthreads under SCHED_FIFO policy saintt Programming 0 11-16-2001 05:41 AM

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

All times are GMT -5. The time now is 01:52 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