Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.arch.embedded > #25813
| Subject | Re: soft real-time on linux |
|---|---|
| Newsgroups | comp.arch.embedded |
| References | <87eg2gerei.fsf@digitalsignallabs.com> <_d-dnYGu4LSuTAbFnZ2dnUU7-SXNnZ2d@supernews.com> <93c91fe0-c28c-4474-bcc0-e8a0a36ba707@googlegroups.com> |
| From | Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> |
| Date | 2017-02-10 11:12 -0500 |
| Message-ID | <mOCdnZCTYJDNewDFnZ2dnUU7-IXNnZ2d@supernews.com> (permalink) |
On 02/09/2017 03:16 AM, Jack wrote: > Il giorno giovedì 9 febbraio 2017 03:17:31 UTC+1, Phil Hobbs ha > scritto: >> >> The Linux thread scheduler is horribly broken, or was last time I >> used it (a while ago, admittedly). The info pages will tell you >> all about how to specify priorities, scheduling algorithms, and so >> forth, but leave out two vital items: >> >> 1. You can only hack those things if you're running as root, and > > the priority of your processes can be modified with "nice". If you > want to change some kernel config of course you need to be root (same > thing in any other OS) Only process-by-process. > >> 2. You can't have both real-time and normal threads in the same >> process. > > since threads are created/destroyed dinamically, and the OS can't > know what the fuck is going on in the thread, it's pretty normal that > the priority is process based and not thread based. Not true in Windows, for instance. It's a serious handicap in my case, where I have compute threads and comms threads in a clusterized simulator: another box can totally stall waiting for a comms thread on the next box to finish its job. It trashes the scaling--Windows boxes scale nearly linearly up to 25 hosts or so, whereas Linux ones start getting less efficient at around 8 hosts. On a single box, the thread scheduler has a global view of what's going on, so it isn't as big a deal. > > If you want to prioritize a particular thread in a process, you need > to do it at programming time. > > good old stackoverflow: > http://stackoverflow.com/questions/3649281/how-to-increase-thread-priority-in-pthreads > Only works as root, and if you want any thread to be real-time, you have to put the whole compute-bound process in the RT class, which brings the system to its knees. What I need is a RT comms thread that is usually blocked on a semaphore and then runs furiously about 1% of the time. > >> >> Both (1) and (2) are easy in Windows (or the late lamented OS/2, >> which > > the (1) is "easy" in win because a normal user is automatically > Administrator, if aou use a user without admin privileges, well you > can change the priority of your processes, but not others. But not the relative priority of threads within the process, whereas you can in Windows. As I said originally, I'd be quite happy to be able just to _reduce_ the priority of the compute threads vs. the comms threads, but _noooooooo_. Broken as designed. Cheers Phil Hobbs -- Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC Optics, Electro-optics, Photonics, Analog Electronics 160 North State Road #203 Briarcliff Manor NY 10510 hobbs at electrooptical dot net http://electrooptical.net
Back to comp.arch.embedded | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
soft real-time on linux Randy Yates <yates@digitalsignallabs.com> - 2016-11-12 08:53 -0500
Re: soft real-time on linux Grant Edwards <invalid@invalid.invalid> - 2016-11-12 17:16 +0000
Re: soft real-time on linux Mel Wilson <mwilson@the-wire.com> - 2016-11-12 17:33 +0000
Re: soft real-time on linux upsidedown@downunder.com - 2016-11-12 20:34 +0200
Re: soft real-time on linux Don Y <blockedofcourse@foo.invalid> - 2016-11-12 13:53 -0700
Re: soft real-time on linux sbattazzo@gmail.com - 2017-02-09 11:06 -0800
Re: soft real-time on linux Paul Rubin <no.email@nospam.invalid> - 2016-11-12 14:12 -0800
Re: soft real-time on linux Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2017-02-08 21:17 -0500
Re: soft real-time on linux Jack <jack4747@gmail.com> - 2017-02-09 00:16 -0800
Re: soft real-time on linux David Brown <david.brown@hesbynett.no> - 2017-02-09 10:00 +0100
Re: soft real-time on linux Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2017-02-10 11:12 -0500
Re: soft real-time on linux George Neuner <gneuner2@comcast.net> - 2017-02-11 01:33 -0500
Re: soft real-time on linux Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2017-02-10 22:10 -0500
csiph-web