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

Python and Yolov5, using a buffer to stabilize FPS create strange pattern

I am not understanding something, maybe someone can shine some light on it. I am doing image recognition in Python with torch (YOLOv5 2023-4-19 Python-3.9.13 torch-2.0.0+cu117 CUDA:0 (NVIDIA RTX A2000 8GB Laptop GPU, 8192MiB) on real time camera…
Temugin
  • 11
  • 4
1
vote
0 answers

UE5/C++: send multiple Scene Capture frames via TCP socket for high-fidelity realtime applications

I am trying to code a realtime system that acquires multiple high-fidelity frames from Unreal Engine 5, and sends them back through TCP socket to a python/matlab server, while getting from the server the pose of the cameras beforehand. I would like…
1
vote
0 answers

Share not showing up in PROFILE_ID/feed, though realtime notification sent

I have a realtime handler setup for an app, and it gets a notification of change in a user's feed (changed_fields': ['feed']) due to a Share of someone else's public Wall Photo. However, when I look at the https://graph.facebook.com/USER_ID/feed…
HoosierDaddy
  • 720
  • 6
  • 19
1
vote
1 answer

Is it possible to make a real-time clock with Django?

I know that Django have a function that can get current time. However, it cannot continuously updates the time to the user interface (Real-time clock). The code for getting the current time. views.py from datetime import datetime from…
lilsnow02
  • 89
  • 7
1
vote
1 answer

Pyzbar library for image processing (for QR code) not working

I want to perform real-time QR code detection and here is the code I use for it: import cv2 import numpy as np from pyzbar.pyzbar import decode cap = cv2.VideoCapture(0) cap.set(3, 640) cap.set(4, 480) while True: success, img = cap.read() …
1
vote
1 answer

What is difference between changing scheduler/setting nice value and applying PREEMPT_RT patch to kernel in Linux?

In my understanding, we can change kernel's scheduling behavior in some way; changing scheduler itself, or setting nice value to a process. These can be used to make processes hold processor core longer time. On the other hand, there is a PREEMPT_RT…
hidetatz
  • 195
  • 8
1
vote
0 answers

How do i convert a live audio stream to 16kHz, 8bit in python in realtime with good quality

For controlling a motor and producing a sound I want to convert windows (or any other live audio stream) to an unsigned 8bit data stream with a frequency of 16kHz or 16 samples per millisecond. I am currently using pyaudio do do this but the signal…
thewill102
  • 11
  • 1
1
vote
1 answer

Real-time Phone call transcription using Twilio and Deepgram

Using Twilio media streams, I want to transcribe outgoing calls. To transcribe real-time audio, Deepgram transcription API used. I was curious about the types of audio that the Twilio stream returned and the types of audio that the Deepgram…
Osman
  • 11
  • 2
1
vote
2 answers

plotting the real time data after certain specified interval in Matlab

I have a question that I dont know how to figure it out. I am plotting my real time data obtained from temperature sensors in MATLAB. The sensor software generates the text file for each sensor and updates it after every minute. What do I have to do…
mirage
  • 145
  • 2
  • 8
  • 19
1
vote
0 answers

How do I create real time transcript of video call?

We are using twilio video call in our application. Need to create real time transcript of that video call. Twilio audio recording creates separate audio file for each participant and so by using AWS transcribe for transcription, it creates 2…
1
vote
1 answer

Kafka Streams combinations of message

I have messages in topic (compact topic): {id: 1, groupId: 1} {id: 2, groupId: 1} {id: 3, groupId: 1} {id: 4, groupId: 2} I want grouped messages by groupId and then get all possible combinations in each group. For example for groupId=1…
Svyat
  • 33
  • 5
1
vote
4 answers

What are the advantages and disadvantages of real time collaboration in an IDE?

I can think of a few disadvantages of having real time collaboration in an IDE like no two people code in the same way so there are chances of semantically conflicting edits that can break the work. But are there any advantages to it? What are the…
Lavanya Mohan
  • 1,496
  • 7
  • 28
  • 39
1
vote
1 answer

Angular Router canActivate Guard, how to deal with real-time?

We can check (restrict/allow) an access to a module in Angular RouterModule using Guards, implementing an canActivate() method. The method can use a business logic to make some checks, lets call it checkAccess() method. And return a boolean…
Sergej
  • 2,030
  • 1
  • 18
  • 28
1
vote
0 answers

How to integrate Realtime Map Tracking in Flutter Project similar to Uber, Ola and Zomato

I want to integrate Realtime Map Tracking for delivery purposes in my Flutter Project. This is a grocery project. I have followed many Articles but the performance of the Map is not smooth. It takes time to update the Map. Please share the solution…
1
vote
0 answers

Using Firestore database to work like Realtime

I've looked in all the other questions on stackoverflow and none of them I got an answer or a tutorial that I can use firestore with realtime. I know it's using the snapshot method, but how can I convert something ready using the conventional…
1 2 3
99
100