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

4560 questions
1
vote
1 answer

What comet server should I choose?

I need to incorporate some real-time features in a web app, mostly notifications and ability to chat between users. I found that APE server fits my needs, they have impressive demos on their site etc. But soon after I started following their docs…
Ian
  • 75
  • 1
  • 4
1
vote
1 answer

in pick_next_highest_task_rt function, should we continue if next->prio <= idx?

I'm studying the linux-3.2.9 kernel, and in sched_rt.c function pick_next_highest_task_rt() there is a for loop that looks at all the rt_rq's to find the (next) highest task. But I'm puzzled by this "if" condition: for_each-leaf_rt-rq(rt_rq, rq) …
mwang25
  • 148
  • 6
1
vote
2 answers

SoundPlayer throws an Exception that wave header is corrupt but it is not

I am developing a simple real time audio library. Where the programmer can make calls to methods that can play audio in real-time. In addition, the programmer can call methods that can play a sine wave at specific frequency and duration in…
Daniel Lopez
  • 1,728
  • 3
  • 24
  • 40
1
vote
1 answer

isolate a cpu in code without sudo?

Is it possible to isolate a cpu from the linux scheduler in code, and to grant a user rights to do this so that he doesn't have to be root? I can readily set a process/thread's cpu affinity: // set thread affinity to core 1 cpu_set_t…
Steve Lorimer
  • 27,059
  • 17
  • 118
  • 213
1
vote
3 answers

Real Time priority in .Net

I have an application that feeds audio data to a FTDI device via the D2XX interface. It works perfectly while my application has focus, and uses very little CPU (5%). But when I hammer the CPU (by switching to other applications, or heavy drawing)…
Maestro
  • 9,046
  • 15
  • 83
  • 116
1
vote
2 answers

Real time UML class diagramming tool for concurrent editors?

I'm looking for something similar to Google Docs, where you can work with other team members simultaneously for class diagramming. I've looked into Creately and Gliffy, but neither support concurrent editors for a real time project. Does anyone know…
Atticus
  • 6,585
  • 10
  • 35
  • 57
1
vote
1 answer

Preemption in Linux Kernel

I am applying real time patch to the linux vanilla kernel. I osadl website recommends kernel version 2.6.33 but it was written in 2010 https://www.osadl.org/Latest-Stable-Realtime.latest-stable-realtime-linux.0.html As I have read linux kernel 3.x…
Berk
  • 338
  • 5
  • 11
1
vote
1 answer

How to implement a manager of scripts execution in php on a remote server

I'm trying to build a service that will collect some data form web at certain intervals, then parse those data, finally upon result of parse - execute dedicated procedures. Typical schematic of service run: Request item list to be updated…
Jimmix
  • 5,644
  • 6
  • 44
  • 71
1
vote
3 answers

Real time process communication in game development

If you make a game architecture that splits up system components (IE, rendering, physics, logic, input, scripting, etc) into different threads, how do you handle cases where real-time communication is necessary? For example, if a script wants to…
Nayruden
  • 205
  • 3
  • 10
1
vote
1 answer

How to access data in AudioQueue buffers?

I am struggling to work out how to pass the data from buffer to an array to allow me to display what is in the buffer. Is there an example of code somewhere that is a simple record audio and read buffer? Simpler the better. I am trying to do…
1
vote
0 answers

Profiling of linux 2.6.32 FIFO realtime scheduler using perf

I am working on an embedded application that requires realtime performance during certain periods of it's execution. I escalate the priority of the application for approximately 150ms with a call to sched_setscheduler( 0, SCHED_FIFO, &s ) where…
Pawel
  • 71
  • 3
1
vote
3 answers

Can raymarching be accelerated under an SIMD architecture?

The answer would seem to be no, because raymarching is highly conditional i.e. each ray follows a unique execution path, since on each step we check for opacity, termination etc. that will vary based on the direction of the individual ray. So it…
Engineer
  • 8,529
  • 7
  • 65
  • 105
1
vote
3 answers

pipe into perl script

I need to pipe certain log entries into a perl script, but I can't get it to work using ARGV or STDIN. tail -f messages | grep --line-buffered "auth failure:" | awk '{print $1,$2,$3,$10}' | test3.pl Perhaps something is being buffered but it…
Xi Vix
  • 1,381
  • 6
  • 24
  • 43
1
vote
1 answer

ASP.NET instant page update from external service

This is a question i've been pondering about for a while :-) Clients are often asking if it's possible to create a real-time page update whenever they upload i.e. a video to their YouTube account, add new images to their Flickr account and such. So…
bomortensen
  • 3,346
  • 10
  • 53
  • 74
1
vote
1 answer

Real-time ping result using ajax

I'm trying to create a web application which can display the results of a ping command real-time. I'm using JSP in the backend. I'm actually getting the result correctly. But the problem is, the result is not displayed in real-time. The application…
Sunil Kumar B M
  • 2,735
  • 1
  • 24
  • 31