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
20
votes
3 answers

Starting point for CLOCK_MONOTONIC

As I understand on Linux starting point for CLOCK_MONOTONIC is boot time. In my current work I prefer to use monotonic clock instead of CLOCK_REALTIME (for calculation) but in same time I need to provide human friendly timestamps (with…
rimas
  • 697
  • 1
  • 8
  • 17
19
votes
2 answers

How to avoid create a new socket connection in socket.io after html page refresh?

I have tried socket.io, I found when client html page load, a new socket connection created.When I refresh the page, I found a new socket connection create, and then the old connection disconnect. My problem is how to avoid this? Because I am…
qichunren
  • 4,003
  • 7
  • 31
  • 48
19
votes
3 answers

What is the most efficient way to draw voxels (cubes) in opengl?

I would like to draw voxels by using opengl but it doesn't seem like it is supported. I made a cube drawing function that had 24 vertices (4 vertices per face) but it drops the frame rate when you draw 2500 cubes. I was hoping there was a better…
Xavier
  • 7,987
  • 13
  • 61
  • 93
19
votes
1 answer

Creating a realtime push notification system for desktop/mobile/web apps using kafka as message broker

I have a use case where there needs to be a real-time communication between servers and clients following a pub/sub messaging pattern. Producers will be server in java, node etc and clients will be - java desktop apps, mobile apps…
19
votes
1 answer

Confusion over choosing Faye or Rails 4 Actioncontroller::Live

I have already used Faye with Ruby On Rails, it's almost at 0 cost for me, because I'm running Faye over another server connected to my Rails App. However I have faced some problems like when a query takes too long on the Rails server, after a while…
0bserver07
  • 3,043
  • 1
  • 23
  • 53
19
votes
3 answers

android getting sound frequencies real time?

I have been trying to get the sound frequency(number) in real time using fft and i am having run time errors. can any one help? package com.example.recordsound; import edu.emory.mathcs.jtransforms.fft.DoubleFFT_1D; import…
Prerak Diwan
  • 197
  • 1
  • 1
  • 10
19
votes
4 answers

Who Uses Real Time Java?

I noticed that Real Time Java 2.2 was released back in September, seems to have come a long way from when I last looked at it. However, does anybody know of any real world uses, commercial or academic to…
Jon
  • 55,763
  • 30
  • 120
  • 149
19
votes
1 answer

Real time, auto updating, incremental plot in R

I'm trying to make a dynamic plot, sort of like auto updating, incremental, possibly real time. I want to accomplish something like this http://www.youtube.com/watch?v=s7qMxpDUS3c This is what I have done so far. Suppose you have a time series in a…
user1507176
  • 193
  • 1
  • 1
  • 4
19
votes
3 answers

Does operational transformation work on structured documents such as HTML if simply treated as plain text?

The FAQ of Google Wave Protocol says that [HTML] "does not have desirable properties" and that "HTML makes OT (Operational Transforms) difficult if not impossible" [1]. Why is this so? What problems arise if HTML is treated simply as plain text and…
18
votes
4 answers

How to set CAP_SYS_NICE capability to a Linux user?

My program is using the Linux system call setpriority() to change the priorities of the threads it creates. It needs to set negative priorities (-10) but, as mentioned on the documentation, this fails when run as a normal user. The user needs the…
CJlano
  • 1,335
  • 1
  • 11
  • 16
18
votes
4 answers

Hadoop, Mahout real-time processing alternative

I intended to use hadoop as "computation cluster" in my project. However then I read that Hadoop is not inteded for real-time systems because of overhead connected with start of a job. I'm looking for solution which could be use this way - jobs…
mmatloka
  • 1,976
  • 1
  • 20
  • 45
18
votes
4 answers

iOS / C: Algorithm to detect phonemes

I am searching for an algorithm to determine whether realtime audio input matches one of 144 given (and comfortably distinct) phoneme-pairs. Preferably the lowest level that does the job. I'm developing radical / experimental musical training…
P i
  • 25,182
  • 33
  • 133
  • 229
18
votes
3 answers

Install RT Linux patch for Ubuntu

Trying to make my generic Ubuntu to real time Ubuntu by modifying the kernel by patching / installing RT Linux but couldn't find a straight setup. Can someone help with the steps?
Abhay Nayak
  • 780
  • 1
  • 8
  • 20
18
votes
3 answers

Storm max spout pending

This is a question regarding how Storm's max spout pending works. I currently have a spout that reads a file and emits a tuple for each line in the file (I know Storm is not the best solution for dealing with files but I do not have a choice for…
Naresh
  • 600
  • 1
  • 3
  • 13
18
votes
4 answers

Realtime Audio with AVAudioEngine

Hej. I want to implement a realtime audio application with the new AVAudioEngine in Swift. Has someone experience with the new framework? How does real time applications work? My first idea was to store the (processed) input data into a…
Michael Dorner
  • 11,986
  • 10
  • 64
  • 95