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
1 answer

How to get realtime data from MySQL using Java

I have set a scheduler every 2 seconds: private static EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory("onezero"); public static void main( String[] args ) { Timer t = new Timer(); …
1
vote
0 answers

Redis for handling high-concurrecy and limited-capacity model?

I have a legacy system for managing courses at the university. Every half year, this happens: limited capacity course (30 people) opens 1000 people trying to enroll in that course at the same time (literally waiting at computers to hit the "enroll"…
Josef Richter
  • 499
  • 1
  • 9
  • 16
1
vote
1 answer

How can I clear thread affinity with sched_setaffinity meaning I want to give control back to the kernel?

I looked everywhere but it appears that cannot be done. What I'm trying to avoid is: "A child created via fork(2) inherits its parent's CPU affinity mask." Source: https://manpages.debian.org/testing/manpages-dev/sched_setaffinity.2.en.html
CCCCoder3
  • 29
  • 3
1
vote
0 answers

Exclude inactive users when sending push notifications and send them after they active

I created a app using laravel and app automatically send real time notifications via pusher. It works perfectly and I used Laravel Broadcast, pusher and Laravel Echo via toBroadcast method. But I need to exclude those notifications from inactive…
Anushka Deshan
  • 71
  • 3
  • 13
1
vote
0 answers

Maintain consistency between multiple datastores

I'm writing real time application that needs fast access to some resources. I'm using a relational database and redis. I use the relational database for safe storing of the resources and redis for fast access of those same resources. The problem…
Tomas Piaggio
  • 541
  • 8
  • 23
1
vote
0 answers

How to store websocket connections for filtering them?

I'm trying to build a system for a transportation company. The company has many trucks and deliver items to different countries. One of the use cases of the system is to track each truck and view it's position in real time. So, each truck send GPS…
1
vote
0 answers

Realtime tracking with Rest Api GeoJson & Leaflet-realtime

I have created a REST API server that returns data in GEOJSON format. Using Leaflet-realtime, I only display the last entered json data on the map. I would like to receive only the last data entered but for each "idResource". enter code…
crisp
  • 11
  • 1
1
vote
0 answers

How to create a live streaming application?

I am working on an application which requires live video streaming feature. Just like Facebook, where a user can broadcast video to audience in real time. Basically, I need to know what are tools and technologies involved to develop a streaming…
1
vote
0 answers

Spring boot MYSQL capture data changes

Can anyone help me how to capture changes on mysql database and send streams when data changes, my server is spring boot. Just i want the technology to use to handle this problem.
Hamza
  • 56
  • 3
1
vote
3 answers

How many channels can Redis support for PUB/SUB?

I just got started with Redis and i'm trying to understand how does it work, so i apologize if what i'm gonna say is not correct. I want to build a real time system where a Python application (which we will call Data Collector) retrieves stock…
Jack022
  • 151
  • 3
  • 12
  • 42
1
vote
0 answers

How to enable listen in objective C(cocoa) to listen to the changes in database?

Hi all. I'm working on a cocoa desktop application. I'm uploding a file to the server, Now i want the other users to get the notifications whenever i upload a new file from my app. and vice versa.. and whenever a file is uploaded to the server from…
Nithin S
  • 109
  • 1
  • 7
1
vote
1 answer

JS Local Network Communication

This question is more about looking for an idea, rather than an implementation or technical solution. I'd like to hear how you would solve this kind of problem (or task). I have an application build with Javascript using React & Meteor. At the…
Dart
  • 13
  • 3
1
vote
1 answer

React for displaying the log file in real-time (Flask backend)

I have a working code (Flask + plain JS) which shows the growing log file in real time. I have a problem converting it to ReactJS. app.py (Flask, working code, no problems) @app.route('/stream') def stream(): def generate(): …
1
vote
3 answers

Socket IO fails to connect within corporate networks

I am just getting to grips with socket.IO and nodeJS. Got my web app working ok with them. I then got a friend to try it out at work on an office machine and found that it failed to connect. I set up these two test…
wilsonpage
  • 16,275
  • 19
  • 98
  • 144
1
vote
2 answers

Does n >> 3 or n & 3 offer any advantage over n/8 or n % 8 respectively?

In my program memory and cpu time are constraints also this calculation will be done around 50000 times every second. Will there be a performance gain if bitwise operators are used over arithmetic ?