Questions tagged [real-time]

A task is real-time when the timeliness of the activities' completion is a functional requirement and correctness condition, rather than merely a performance metric. A real-time system is one where some (though perhaps not all) of the tasks are real-time tasks. DO NOT USE THIS TAG if all you mean is 'real-world'.

Definition

A task is real-time when the timeliness of the activities' completion is a functional requirement and correctness condition, rather than merely a performance metric. A real-time system is one where some (though perhaps not all) of the tasks are real-time tasks.

Real-time Systems

The term real-time is used in at least two distinct ways when referring to computer systems:

  • In the academic sense of real-time, a program or system is "real-time" when it is subject to execution time constraints, such as deadlines. Such systems are broken down into soft and hard real-time. Correctness of an implementation depends not only on the values produced by the program, but on the time at which those values are produced.

    • Hard real-time systems are those in which no deviation from the time constraints (e.g., missed deadlines) are tolerable, and any failure constitutes a complete failure of the system.
    • Soft real-time systems tolerate some degree of deviation from the time constraints, for example media streaming systems, in which some late packets may degrade the quality transiently, but still produce an acceptable execution.
  • As a synonym for "on-line", wherein the program must respond to events "in real-time", whether or not there is an actual time constraint involved. (e.g., real-time stock quotes or whatever.)

Wikipedia has a useful discussion.

Determinism

Some contributors, particularly in the defense and aerospace community, use terms like time-critical or dynamic time-critical instead, to denote systems that have real time constraints. The term real-time is sometimes problematic because it implies determinism (which is not always required or even desired) and it also has the baggage of some very specific theory and implementation history. Nevertheless, there exist highly dynamic systems which nevertheless have time constraints, and a great deal of engineering time is spent using a combination of hard and soft real-time approaches and custom hacks to meet those requirements.

If I have a system with well-defined tasks, and I want to say that task X must complete by time t with probability 0.95, is that a hard or a soft real-time task?

Composition of Tasks

Note that many real-time systems are composite, consisting of tasks and activities requiring varying degrees of timeliness predictability.

Foundations

Here are some foundational questions on StackOverflow and other resources to help understand the concepts of real-time:

Resource Management

Ensuring that activities in a real-time system typically rests in characterizing the activities' resource demands and then managing resources to satisfy them.

Characterization of resource demands usually includes at least an execution time analysis. A common measure is Worst Case Execution Time (WCET), typically given by a combination of empirical data and analysis. In addition, it is often necessary to capture other resource demands like I/O or "logical" resources like locks/mutexes/semaphores. A common metric in this dimension is blocking factor.

Once the activities have been characterized, explicit disciplines are employed to ensure timeliness. Historically, this has been done entirely manually, for instance by employing a cyclic executive design pattern. If the system is constructed atop a multi-process or multi-threaded platform, scheduling and synchronization disciplines must be used. The most common type of scheduler in RTOS is a priority scheduler, in which ready activities receive CPU time in order of their expressed priority. While most real-time activities' time constraints are articulated in terms of deadlines, few or no RTOS provide an explicit deadline scheduler. Instead, periodic or sporadic activities with deterministic deadlines are assigned priorities using Rate Monotonic Analysis (RMA) to map them onto fixed priorities.

Standards

Implementation / Platforms

This section will summarize language, operating systems, middleware, and other implementation components common in RT systems.

Examples

FAQs

4299 questions
24
votes
3 answers

What are the Netty alternatives for high-performance networking?

I am in the process of choosing a networking library to implement a client/server system that cannot spare any microsecond. It will implement its own protocol to send and receive messages. I am looking for a good NIO framework that will allow me to…
chrisapotek
  • 5,487
  • 11
  • 46
  • 82
24
votes
3 answers

SignalR WebSockets on IIS 7.5

On my IIS 7.5, my SignalR application always used long polling. As per my search, IIS 7.5 does not support WebSockets yet. I hope, I missed some tools or configurations to enable WebSockets in IIS 7.5. Or I didn't?
ZeroHackeR
  • 563
  • 1
  • 5
  • 7
23
votes
1 answer

FB Realtime API not/inconsistently notifying for certain connections (music, movies, books, tv)

I'm currently running into an issue with Facebook's realtime API. I wish to subscribe to a number of things on a users profile, including their "Likes" in the Music, Books, TV and Movies categories. I get the correct information when I query via FQL…
Chris S
  • 385
  • 1
  • 8
23
votes
1 answer

How to solve limitations of SignalR in scaleout for backplane

I use ASP.NET MVC and C# .I found SignalR for transfer data in real time,but signalR have some limits. according to the issue for this : Using a backplane, the maximum message throughput is lower than it is when clients talk directly to a single…
Amir Movahedi
  • 1,654
  • 3
  • 26
  • 49
23
votes
4 answers

How do I gracefully interrupt urllib2 downloads?

I am using urllib2's build_opener() to create an OpenerDirector. I am using the OpenerDirector to fetch a slow page and so it has a large timeout. So far, so good. However, in another thread, I have been told to abort the download - let's say the…
Oddthinking
  • 21,437
  • 19
  • 76
  • 115
22
votes
1 answer

Real-time data push from server to iOS device WITHOUT APNS

I'm building an iOS app which needs real-time updates from the server, and I'd like to accomplish this without polling. Does anyone know of technologies, tools, products or libraries which would facilitate this functionality?
Marcus Blankenship
  • 521
  • 1
  • 5
  • 10
22
votes
3 answers

Lisp on embedded platforms

Are there any open source Lisp compilers suitable for real-time embedded applications? I.e. with incremental garbage collection, customisable memory handling, small footprint, etc. Edit: To clarify, by "compiler" I meant native code, not bytecode…
absence
  • 791
  • 1
  • 6
  • 13
22
votes
6 answers

Performance hit of vtable lookup in C++

I'm evaluating to rewrite a piece of real-time software from C/assembly language to C++/assembly language (for reasons not relevant to the question parts of the code are absolutely necessary to do in assembly). An interrupt comes with a 3 kHz…
user2711077
  • 221
  • 2
  • 6
21
votes
1 answer

Real-time audio analysis with R

Is it possible to use R to perform a real-time (or with a minimal delay) analysis of audio recorded through the computer's microphone? While R has some well rounded packages for analysing audio files (such as package seewave) or to record sound…
JohnBee
  • 1,512
  • 1
  • 13
  • 18
21
votes
2 answers

Python subprocess with real-time input and multiple consoles

The main issue In a nutshell: I want two consoles for my programm. One for active user input. And the other one for pure log output. (Working code including the accepted answer is in the question's text below, under section "Edit-3". And under…
Jonathan Root
  • 524
  • 2
  • 11
  • 30
21
votes
4 answers

Which real-time (RTSJ) JVM is most preferred?

There seems to be only a handful of JVMs that are implementations of the Real-Time Specification for Java (RTSJ). The Sun/Oracle Java Real-Time System is over $6000 and IBM's real-time WebSphere is over $7000, so many Java developers may never have…
Matt
  • 3,194
  • 3
  • 21
  • 31
20
votes
2 answers

D3 Real-Time streamgraph (Graph Data Visualization)

I would like a stream graph as in this example: http://mbostock.github.com/d3/ex/stream.html but I would like real time data entering from the right and have old data leave from the left, such that I always have a window of 200 samples. How would I…
rustybeanstalk
  • 2,602
  • 8
  • 33
  • 56
20
votes
4 answers

How to use K.get_session in Tensorflow 2.0 or how to migrate it?

def __init__(self, **kwargs): self.__dict__.update(self._defaults) # set up default values self.__dict__.update(kwargs) # and update with user overrides self.class_names = self._get_class() self.anchors = self._get_anchors() …
20
votes
9 answers

Java for Audio Processing is it Practical?

Is Java a suitable alternative to C / C++ for realtime audio processing? I am considering an app with ~100 (at max) tracks of audio with delay lines (30s @ 48khz), filtering (512 point FIR?), and other DSP type operations occurring on each track…
JeffV
  • 47,302
  • 31
  • 96
  • 120
20
votes
6 answers

Ideas for scaling chat in AWS?

I'm trying to come up with the best solution for scaling a chat service in AWS. I've come up with a couple potential solutions: Redis Pub/Sub - When a user establishes a connection to a server that server subscribes to that user's ID. When someone…
Brian DiCasa
  • 9,073
  • 15
  • 61
  • 93