Results 1 to 6 of 6
It there a way in linux to force atomicity of user code sections on a multi-core x86 chip?
I know in classes I have taken we disable/enable interrupts, but I ...
- 06-29-2010 #1Just Joined!
- Join Date
- May 2010
- Posts
- 28
forcing atomicity in user code (C++)
It there a way in linux to force atomicity of user code sections on a multi-core x86 chip?
I know in classes I have taken we disable/enable interrupts, but I don't think that works on a CMP.
Basically, I want to stop the kernel from being able to switch off my process for some period of time.
- 06-29-2010 #2Linux Newbie
- Join Date
- Mar 2010
- Posts
- 121
Why are you wanting to do this? There are various ways you can "ask" Linux to give you a higher priority, more CPU time, less chance of being swapped out and such, but it depends on how much of a guarantee you need about this.
If you want to 100% guarantee your process will get CPU time whenever it wants, you'd need to compile a real-time kernel. Just making the kernel is a lot of work, and programming real-time systems is a large and complex topic, and the odds are you don't need to be completely sure about how much CPU time you get.
For slightly weaker assertions, see the sched_setscheduler(2) man page. You'll want to read it ALL.
- 06-29-2010 #3Just Joined!
- Join Date
- May 2010
- Posts
- 28
- 06-29-2010 #4
i think RHEL/centos might have a RT kernel package you can readily install, otherwise you may have to build your own kernel (not very hard)
i would just do some googling for distros with RT kernel options
- 06-29-2010 #5Just Joined!
- Join Date
- May 2010
- Posts
- 28
- 07-04-2010 #6Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
Unfortunately, even so-called RT Linux is not truly deterministic. I would advise that you invest in a good commercial real-time operating system that can easily do what you need, yet communicate easily with a Linux front-end. One good one is QNX - they have free or low-cost licenses for academic and personal use. Go to QNX Realtime Operating System (RTOS) software, middleware, development tools and services for superior embedded design for more information.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote
