Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
Hi everybody, I have a real big problem to solve... Is possible, with RedHat enterprise 6.0, to run a C/C++ routine or program ensuring that no other processes (also kernel ...
  1. #1
    Just Joined!
    Join Date
    Nov 2011
    Posts
    5

    OS Inhibition

    Hi everybody,
    I have a real big problem to solve...
    Is possible, with RedHat enterprise 6.0, to run a C/C++ routine or program ensuring that no other processes (also kernel processes) stop its execution?

    p.s. I can't recompile the kernel for this purpose.

    Please help me if you can!

  2. #2
    Linux Guru
    Join Date
    May 2011
    Posts
    1,843
    You can trap pretty much every signal inside your prog (or script for that matter) except for the KILL sig, as far as I know. So I would think the answer is No. You could certainly have something else running (cronjob, daemon, etc.) that monitors a process name and restart it, if it is not found running. You could also monitor/control it via /etc/inittab, but the use of that file is disappearing in Linux. Probably a way to do that now w/systemd but I haven't taken the time to figure it out yet.

    Why must the prog not be allowed to be terminated, btw? That might cause lock-ups upon reboot, come to think of it.

  3. #3
    Just Joined!
    Join Date
    Nov 2011
    Posts
    5
    Thanks for your reply! I need to be able to launch a C routine for test, and as you know, if some other instruction are executed, the test will fail also if no faults are present in the system (i.e. instruction cache test).
    So I really need to be sure that no other processes are scheduled (and instruction executed) while the test is running...

  4. #4
    Linux Guru
    Join Date
    May 2011
    Posts
    1,843
    This sounds a little different than your original post.

    So there are other specific processes that might conflict with your test program? If they are running, should your program terminate them, or exit itself?

    Or are you saying that multiple copies of the same program might be running and you wish to avoid that (i.e. check for an instance of self and exit, if running)?

    Or is it something else?

  5. #5
    Just Joined!
    Join Date
    Nov 2011
    Posts
    5
    Hi, it is assumed that every other instruction executed could be loaded in cache, if executed. This kind of execution of other instructions during the execution of the test is deprecable... only one copy of the test is executed. I would launch the test and be sure that no other instructions are executed until the test finish...

  6. #6
    Linux Enthusiast Mudgen's Avatar
    Join Date
    Feb 2007
    Location
    Virginia
    Posts
    623
    Quote Originally Posted by atreyu View Post
    This sounds a little different than your original post.

    So there are other specific processes that might conflict with your test program? If they are running, should your program terminate them, or exit itself?

    Or are you saying that multiple copies of the same program might be running and you wish to avoid that (i.e. check for an instance of self and exit, if running)?

    Or is it something else?
    I don't think it's inconsistent from the first post, but it's not the inference I drew, either. I think OP wants to guarantee that the process doesn't get bumped off the cpu by the scheduler, and I don't think that's possible with an unmodified kernel.

  7. #7
    Linux Guru
    Join Date
    May 2011
    Posts
    1,843
    Quote Originally Posted by Mudgen View Post
    I don't think it's inconsistent from the first post, but it's not the inference I drew, either. I think OP wants to guarantee that the process doesn't get bumped off the cpu by the scheduler, and I don't think that's possible with an unmodified kernel.
    I reread it again and I still can't quite get what he wants. So if you're right, by "bumped off", do you mean niced down, or terminated, or what?

  8. #8
    Linux Enthusiast Mudgen's Avatar
    Join Date
    Feb 2007
    Location
    Virginia
    Posts
    623
    Quote Originally Posted by atreyu View Post
    I reread it again and I still can't quite get what he wants. So if you're right, by "bumped off", do you mean niced down, or terminated, or what?
    I mean I think he wants it to hold the cpu exclusively. He'd have to tell us for sure.

  9. #9
    Just Joined!
    Join Date
    Nov 2011
    Posts
    5
    Hi,
    Mudgen you're right!
    This process could use exclusively the cpu, until he finished.

  10. #10
    Linux Guru
    Join Date
    May 2011
    Posts
    1,843
    Have you already played with nice? e.g. nice -20 yourprog nice 19 otherprogs

    It's not exclusively giving yourprog CPU utilization, but it's a step in the right direction.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...