Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.arch.embedded > #25811

Re: soft real-time on linux

From David Brown <david.brown@hesbynett.no>
Newsgroups comp.arch.embedded
Subject Re: soft real-time on linux
Date 2017-02-09 10:00 +0100
Organization A noiseless patient Spider
Message-ID <o7havn$tiu$1@dont-email.me> (permalink)
References <87eg2gerei.fsf@digitalsignallabs.com> <_d-dnYGu4LSuTAbFnZ2dnUU7-SXNnZ2d@supernews.com> <93c91fe0-c28c-4474-bcc0-e8a0a36ba707@googlegroups.com>

Show all headers | View raw


On 09/02/17 09:16, 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)
> 
>> 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.
> 
> 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
>
> 
>> 
>> 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.
> 

And the (2) is "easy" in Windows because windows is poor at process
handling, and compensates by being quite good at thread handling.  Linux
(like other *nix) has always prioritised good process handling - it does
not /need/ such flexibility in thread prioritising, but that is simply
not the way you design programs in Linux.  If you want a program that
involves hard (or as hard as possible) real-time control of a motor,
soft real-time logging of the data, and non-real-time display on a gui,
you organise it differently on Windows and Linux.  With Windows, you put
everything in one process and have separate threads, because passing
data between processes is inefficient.  With Linux, you use three
separate processes with different priorities.

Back to comp.arch.embedded | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


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