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

Creating a browser based RTS game without a service

I'm planning on creating a browser based RTS game using ASP.NET and MySQL. I was wondering if there is a way to do this without having a central server running all the time - i.e. if all commands can be completed client side when a player logs on…
jdtaylor
  • 334
  • 2
  • 5
  • 20
1
vote
1 answer

Can realtime priority damage a CPU, or lock up the OS even if it has more cores than the number of THREAD_PRIORITY_TIME_CRITICAL threads?

I'm looking for Fresh Response to the outdated responses (and contradictions) I found here and elsewhere. I need to use REALTIME_PRIORITY_CLASS, THREAD_PRIORITY_TIME_CRITICAL, on a few threads. The Responses here and elsewhere are similar to the…
Adrian E
  • 29
  • 6
1
vote
1 answer

rails 3.1 realtime update feature

I've seen many sites that their messages feed is keep sliding down incessantly. For example: the previous version of twitter and now the foursquare. How to do that? Moreover, I also want to know how to implement meetup's RSVP instant push in rails,…
Jason Wong
  • 21
  • 4
1
vote
1 answer

Can I have realtime scheduling within my process (but without affecting others)?

According to my question here I would like to use SCHED_RR with pthread_setschedparam for my threads in a Linux application. However, this has effects even on kernel modules which I currently cannot solve. I have found…
Philipp
  • 11,549
  • 8
  • 66
  • 126
1
vote
1 answer

rails 3.1 auto-completion and realtime update in rails

Can anyone tell me how to easily implement auto-complete in rails 3.1?thanks. p.s. What's the best solution for simple_form to do this?? Besides, I also want to know how to implement meetup's RSVP instant push in rails? I have the following form,…
Jason Wong
  • 21
  • 4
1
vote
0 answers

Reactjs Auto Scroll: How to improve the performance of auto scroll when there are many records (500 or more)

Currently I'm building a function that automatically scrolls back the list. Example: I have an array [1,2,3,4,5,6,7,8,9], on the interface I will give it auto-scroll from 1 to 9 and when the number 9 is displayed, the number 1 will be serialized…
1
vote
1 answer

CurlUrlInvalidException : Facebook Real time update

I was trying to implementing facebook real time update. It looks like i was able to subscribe. `$param = array( 'access_token' => $user_access_token, 'object' => 'user', 'fields' => 'name', …
Praveen
  • 1,781
  • 6
  • 26
  • 32
1
vote
2 answers

IS it possible to get real-time updates for friend requests?

The real time doc page doesn't mention friend requests, so i was wondering if an app can get real time updates if a user has a new friend request?
doro
  • 35
  • 4
1
vote
0 answers

How do I prevent crackles and pops while passing input audio to output in CPAL?

I've recently started learning audio programming, and I'm currently trying to write a Rust program using CPAL that will pass the input audio directly to the output. I've been referencing this example code, but the audio comes out distorted and…
1
vote
0 answers

Why does CFS implement 100 Realtime runqueues?

In the documentation available from linux kernel, docs.kernel.org, under Chapter 6: Scheduling Classes for the topic CFS Scheduler, it says this: sched/rt.c implements SCHED_FIFO and SCHED_RR semantics, in a simpler way than the previous vanilla…
marian
  • 27
  • 7
1
vote
1 answer

How can I use shmget to implement shared-memory in a Java application?

Is there a good way, native through JNI or not, to do shared-memory in Java using shmget? I'm currently doing shared-memory through a memory mapped file, but I want to do it in a non-file way through shmget. More info here:…
1
vote
1 answer

How to stream audio in real time as I'm receiving the audio bytes in python?

I have an API endpoint that is streaming bytes of audio to me in real time in an mp3 format. I want to know if I can start playing audio as soon as I start getting these bytes. How can I do this? p = pyaudio.PyAudio() stream =…
1
vote
0 answers

Dash Plotly Live-Updating Graph Not Refreshing in Browser

I've been developing a live-updating cryptocurrency tracker using Plotly's Dash in Python. The application retrieves data from an API and updates the graph every minute. However, I've encountered a problem where the graph does not update in the web…
1
vote
0 answers

How to know the Delivery status of SMS sent by at+commands in vb.net

I use these following at+commands in vb.net to send sms AT+CMGF=1 AT+CMGS="PHONE NUMBER" >HELLO WORLD How am I going to determine if it really send or it fails to send? I want to know the real time status of my message I'm expecting like say for…
1
vote
3 answers

Real Time Image Processing in Android using the NDK

Using an Android (2.3.3) phone, I can use the camera to retrieve a preview with the onPreviewFrame(byte[] data, Camera camera) method to get the YUV image. For some image processing, I need to convert this data to an RGB image and show it on the…
Knots
  • 551
  • 8
  • 19
1 2 3
99
100