LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 09-10-2003, 05:06 PM   #1
DocBexter
LQ Newbie
 
Registered: Sep 2003
Location: Berlin
Posts: 5

Rep: Reputation: 0
uninterruptable parts of code


ive been playing around with sched_fifo but it doesnt seem to do a good job since small cpu loads just interrupt my critical code...

so im asking if there is a command like "do-not-disturb" so some parts of code get processed without interruption ??

the basic idea is:

do_sth_meaningless();
do_not_disturb();
do_critical_code();
please_disturb();
 
Old 09-10-2003, 05:16 PM   #2
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
Vague info:
There's the ability to set the nice-ness of an executed process in linux, and also iirc each app gets 10millisecond time slices of uninterrupted execution (dunno about IRQ handling) by default. But I really cant help more
 
Old 09-10-2003, 05:45 PM   #3
DocBexter
LQ Newbie
 
Registered: Sep 2003
Location: Berlin
Posts: 5

Original Poster
Rep: Reputation: 0
nice is set to -20
sched_fifo to set_max_prio

but this all doesnt help much ... some soft or hard irq interrupts my code and i can say good bye to my critical code ....
 
Old 09-10-2003, 07:19 PM   #4
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 51
just imagine if there was a userspace 'do-not-disturb' function, i would give it 30s before a script-kiddie came along and did
Code:
int main()
{
    do_not_disturb();
    while(1);
    return 0;
}
so you can see why its a terrible idea. if your doing some low level hardware stuff and really do need a do-not-distrurb then do your stuff in kernel mode. if you could explain why you need it in userspace then perhaps we can help.
 
Old 09-11-2003, 04:33 AM   #5
DocBexter
LQ Newbie
 
Registered: Sep 2003
Location: Berlin
Posts: 5

Original Poster
Rep: Reputation: 0
this statement would be ok if we were talking about java or script languages but c needs to be powerful - i mean this is not a place like a white box where we put kiddies in so they can jump against the walls ....

but since i didnt find anything that helps ill be really goin to kernel space and use the lock hammer "cli sti"
 
Old 09-11-2003, 05:56 AM   #6
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 51
Quote:
this statement would be ok if we were talking about java or script languages but c needs to be powerful - i mean this is not a place like a white box where we put kiddies in so they can jump against the walls ....
its got nothing to do with C, its to do with the kernel. unix kernels(and NT kernels and probably win95+) dont provide a userspace function with the ability to halt the system, nor do they let you do direct hardware io, it would be absurd to do so.

Quote:
but since i didnt find anything that helps ill be really goin to kernel space and use the lock hammer "cli sti"
im not a kernel programming expert but i wouldnt use the machine instructions directly, i would find their wrappers because the 2.5/2.6 series kernel allow user mode to preempt kernel mode, which would be very bad if you had cli'ed and then it jumped into user mode.

if your not writing a hardware driver, then i cant see any valid reason why you need to not be disturbed by the system, maybe your thinking about your problem the wrong way, as i say if you explain what your trying to do then maybe we can help.
 
  


Reply



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
User Preferences: Use HTML code instead of vB code? (vB code is overrated) stefanlasiewski LQ Suggestions & Feedback 5 07-26-2005 01:37 AM
ugrading parts of 9.0 to 9.2 bbking SUSE / openSUSE 3 12-01-2004 11:14 AM
Parts KrYpToN Linux - Hardware 1 03-24-2004 11:13 PM
How does one go about becoming a mod around these parts? Kramer General 1 01-26-2004 05:32 PM
LILO stuck in uninterruptable sleep m0rl0ck Linux - Software 1 08-31-2003 02:10 AM

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

All times are GMT -5. The time now is 05:09 PM.

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