Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 07-29-2003, 07:47 AM   #1
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)


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


Old 07-29-2003, 07:59 AM   #2
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
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
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



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 > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:47 AM.

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