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
1
vote
0 answers

Redis Streams for implementing a Messaging System (chat) app versus traditional approaches

I'm implementing a chat app, which will support both one-on-one conversation and Group conversations. So far the direction was to use Redis Pub/Sub with PostgreSQL as the cold storage, and WebSocket being the transport. Every user will fetch the…
BVtp
  • 2,090
  • 2
  • 21
  • 50
1
vote
1 answer

How to show incoming video call using react native agora

I want to add real time calling feature in my react native app. I am using agora with socket.io to make it real time and it's working fine when app is in foreground, but I am stuck when app is closed because socket does not work when app is closed I…
hamza
  • 11
  • 3
1
vote
1 answer

Creating Unique threads for unique ID in python flask threading in socketio

I have a python flask application which can receive data from a json request and then process. A sample of my code is as below: - # Start with a basic flask app webpage. from flask_socketio import SocketIO, emit from flask import Flask,…
Jay
  • 23
  • 4
1
vote
2 answers

How can I save text diffs?

This is language agnostic (but I am using PHP and MySQL if it helps). How can I save MASSIVE amounts of text data efficiently? Google Docs, for example, autosaves a document and saves every version of that document. I imagine they don't store EACH…
Shamoon
  • 33,919
  • 63
  • 225
  • 452
1
vote
0 answers

live.js vs. python SimpleHTTPServer

The idea To speed up my development I want to automatically refresh the browser if I change the file test.html. My setup I'm on Linux and I start my server with python -m SimpleHTTPServer in a terminal so that I can open my test.html in my browser…
Sr. Schneider
  • 407
  • 5
  • 14
1
vote
1 answer

Sending data from MATLAB to Processing in real time?

Is there any way to send strings from one code to another while they're both running on the same machine? I'm trying to collect information using MATLAB and send a string whenever an event triggers. On Processing, I'm waiting for the string to be…
KGhadiri
  • 49
  • 5
1
vote
1 answer

Real Time chart performance issue c# winform

I am currently using liveChart to plot a real time graph of 3 values: a position, a load and a deformation. The program is based on the Doli.DoPE library (a proprietary dll) In MainForm.cs, there is an event that is triggered everytime the sensor…
MaximeS
  • 79
  • 7
1
vote
2 answers

How can i get Realtime Data from API using Retrofit android

Hello Guys I am trying to realtime get data when change data in API automatic referesh my layout and updated data show it. How can i do that? Here is my Code :- I use this Dependencies :- // retrofit, gson implementation…
1
vote
1 answer

Using Python To Plot Live Lidar Data Causing Circular Plots

I am using the RPLidar A1: https://www.adafruit.com/product/4010 My goal is to collect data sets and plot them in order to get a live visual representation of the data. My current code is: import numpy as np import matplotlib.pyplot as plt from…
LearnIT
  • 304
  • 1
  • 4
  • 21
1
vote
0 answers

How to assess confidence score of a real-time prediction

I have a system that recognizes faces in real-time. I've collected facial features from two different people and labeled the features as "1" and "2". Currently, I'm able to recognize these two people in real-time using the following code…
1
vote
1 answer

Real time checking of database to send command

I'm working with user accoutns for a telephone system and I need to disconnect users once their balance has reached zero. User initiates call Current balance is retrieved Price for phone call is calculated and it is worked out how many whole…
user140291
1
vote
1 answer

Flash real-time information connection over wifi (lan?)

I would like to create a flash-based app for a tablet that sends messages to a 'receiver' app on the same wifi network. So I can have a bunch of tablets with app A that send info to app B, all on the same network. What's the best way to do this?
Mike
  • 13
  • 3
1
vote
2 answers

Reading from serial port and plot real-time C#

I receive data from a serial port and I save it in a buffer. Then, with a Thread that is continously executing, I preprocess the data in the buffer, I plot it and I save it in another buffer. At the beginning, it works perfectly. But after some…
1
vote
1 answer

Update polygon leaflet realtime

I am trying to display a polygon from an external geojson file, the data loads but does not update the polygon in real time. The polygon is added but color is not updated after interval when level changes. Heres is my code: L.realtime({ url:…
DevKer
  • 15
  • 1
  • 7
1
vote
2 answers

Use of malloc in Real Time application

We had an issue with one of our real time application. The idea was to run one of the threads every 2ms (500 Hz). After the application ran for half or an hour so.. we noticed that the thread is falling behind. After a few discussions, people…
BhanuKiran
  • 947
  • 1
  • 10
  • 20
1 2 3
99
100