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


Groups > comp.arch.embedded > #25483

soft real-time on linux

From Randy Yates <yates@digitalsignallabs.com>
Newsgroups comp.arch.embedded
Subject soft real-time on linux
Organization Digital Signal Labs
Date 2016-11-12 08:53 -0500
Message-ID <87eg2gerei.fsf@digitalsignallabs.com> (permalink)

Show all headers | View raw


Hello All,

I have a requirement to port the MSTP physical layer (basically RS-485)
of the BACnet protocol stack to linux. The protocol requires certain
timing to be met, for example, the response to a "Poll For Master" must
be less than 20 milliseconds.

In order to develop this in as short an amount of time, I'd like to use
simple threads and read()/write() commands. However, the standard linux
kernel is not real-time, so any thread could be blocked for an unknown
amount of time. Thus for example a thread that is listening for a "Poll
For Master" packet might not run for more than 20 milliseconds after the
packet was received, thus missing the poll.

But missing a poll is not the end of the world. Eventually (and fairly
quickly) another PFM will be sent out and the device would have another
chance to respond.

Let us also presume such is the case for other response/time violations
throughout the protocol.

The question is, could such an application be written that was "close
enough to real-time" on a standard (non-real-time) kernel? 

I was told by someone on the ##kernel channel that if the kernel is
compiled with "preemptive" enabled, there is a way to set a thread's
priority to "real-time" and it will not only have priority over other
user-land threads but also will preempt much of the kernel's internal
threads. This sounds promising.

If this isn't "good enough" (which is not really well-defined at
this point), there are two alternatives that I can think of:

  1. Switch to the real-time kernel.

  2. Write our own interrupt handler/driver.

I'm not very confident as to which direction to go. Any input would be
appreciated.
-- 
Randy Yates, DSP/Embedded Firmware Developer
Digital Signal Labs
http://www.digitalsignallabs.com

Back to comp.arch.embedded | Previous | Next — 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