ArticleslgStudy

computer science

QP (framework)

QP (framework) is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand QP (framework) rather than just read about it. In short: QP (Quantum Platform) is a family of open source real-time embedded frameworks (RTEFs) and runtime environments based on active objects (actors) and hierarchical state machines (UML statecharts). The QP family consists of the lightweight QP/C and QP/C++ frameworks, written in C (C99) and C++ (C++11), respectively.

QP (framework) — main illustration
QP (framework) — illustration

Key takeaways

  • QP (framework) belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect QP (framework) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of QP (framework) from memory before moving on to harder problems.

Reference excerpt

QP (Quantum Platform) is a family of open source real-time embedded frameworks (RTEFs) and runtime environments based on active objects (actors) and hierarchical state machines (UML statecharts). The QP family consists of the lightweight QP/C and QP/C++ frameworks, written in C (C99) and C++ (C++11), respectively.

Active Objects (Actors) For Real-Time The QP RTEFs are an implementation of the Active Object (Actor) model of computation, specifically tailored for real-time embedded (RTE) systems. Active Objects (Actors) can be combined with a wide variety of threading models, including real-time kernels (RTOS kernels). In the latter case, the combination, designed for deterministic performance, is called the Real-Time Embedded Framework (RTEF). This framework uses higher level abstractions than Real-Time Operating System (RTOS) in graphical modelling and code generation to embedded systems, which create safer, and more responsive applications.

Comparison to RTOS Compared to a (real-time) framework, when using an RTOS, the main part of each individual thread can be written in the application itself and the various RTOS services can be called from there (e.g. a time delay or a semaphore). When you use a framework, you reuse the overall architecture (such as the event loop for all private threads of Active Objects) and you only write the code that the RTEF calls. This leads to inversion of control, which allows the RTEF to automatically enforce the best practices of concurrent programming.

Hierarchical State Machines The behavior of active objects (actors) is specified in QP by means of hierarchical state machines (UML statecharts). The frameworks support manual coding of UML state machines in C or C++ as well as fully automatic code generation by means of the free graphical QM modeling tool. The QP frameworks and the QM modeling tool are used in medical devices, defense & aerospace, robotics, consumer electronics, wired and wireless telecommunication, industrial automation, transportation, and many more.

QP architecture and components QP consists of a universal UML-compliant event processor (QEP), a portable, event-driven, real-time framework (QF), a selection of built-in real-time kernels (QV, QK, or QXK), and a software tracing system (QS).

QEP (QP Event Processor) is a universal UML-compliant event processor that enables direct coding of UML state machines (UML state charts) in highly maintainable C or C++, in which every state machine element is mapped to code precisely, unambiguously, and exactly once (traceability). QEP fully supports hierarchical state nesting, which enables reusing behavior across many states instead of repeating the same actions and transitions over and over again. QF (QP Active Object Framework) is a highly portable, event-driven, real-time application framework for concurrent execution of Active Objects specifically designed for real-time embedded systems. QV (Cooperative Kernel) is a tiny cooperative kernel designed for executing active objects in a run-to-completion (RTC) fashion. QK (Preemptive Kernel) is a tiny preemptive non-blocking run-to-completion kernel designed specifically for executing state machines in a run-to-completion (RTC) fashion. QXK (Dual-Mode Kernel) is a tiny preemptive blocking kernel designed for hybrid applications consisting of active objects and traditional blocking threads. QS (QP/Spy) is a software tracing system that enables live monitoring of event-driven QP applications with minimal target system resources and without stopping or significantly slowing down the code.

Standalone (Bare-Metal) Operation The QP RTEFs can run standalone, completely replacing the traditional RTOS. The frameworks contain a selection of built-in real-time kernels, such as the cooperative QV kernel, the preemptive non-blocking QK kernel, and the unique preemptive, dual-mode (blocking/non-blocking) QXK kernel. Standalone QP ports and ready-to-use examples are provided for ARM Cortex-Mas, as well as other CPUs.

Traditional RTOS Integration The QP RTEFs can also work with many traditional third-party RTOSes. QP ports and ready-to-use examples are provided for several RTOSes (such as Segger Microcontroller Systems#embOS, ThreadX, FreeRTOS, uC/OS-II, etc.) The most important reason why you might consider using a traditional RTOS kernel for executing event-driven QP applications is compatibility with the existing software. For example, many communication stacks (TCP/IP, USB, CAN, etc.) are designed for a traditional blocking kernel. In addition, a lot of legacy code requires blocking mechanisms, such as semaphores or time-delays. A traditional RTOS allows you to run the existing software components as regular “blocking” threads in parallel to the event-driven QP™ active objects.

General Purpose OS Integration The QP RTEFs can also work with general purpose OSes, such as Linux (POSIX), Windows, and macOS. The QP ports to the general purpose operating systems are interested in their own right. For example, the QP port to POSIX supports real-time extensions and works with embedded Linux, and POSIX subsystems of such RTOSes as: QNX, INTEGRITY, VxWorks, etc. Similarly, QP port to Windows can work with Windows IoT or Windows Embedded Compact. But the OS support can be also interesting for developing of deeply embedded code on the desktop workstations, which is called "dual-targeting".

Licensing QP framework are dual-licensed under the open source GPLv3 and a selection of traditional, closed-source licenses. Users who wish to distribute QP (e.g. embedded inside devices) can retain the proprietary status of their code by applying for a commercial license.

See also Embedded operating system Real-time operating system

References

External links state-machine.com QP frameworks on GitHub QP frameworks on SourceForge qf4net: Quantum Framework for .Net qfj: Quantum Framework for Java on SourceForge.net Miros: a hierarchical state machine module in Python Miros: a hierarchical state machine module in Lua State-Oriented Programming (Groovy) ACCU Overload Journal #64 "Yet Another Hierarchical State Machine" C/C++ Users Journal "Who Moved My State?" C/C++ Users Journal "Deja Vu" Research on Open CNC System Based on Quantum Framework Active Objects by Schmidt

Illustrations

QP (framework) illustration
QP (framework): Figure 1: Block diagram showing QP components and their relationship to the hardware and the application
Figure 1: Block diagram showing QP components and their relationship to the hardware and the application

Worked examples

Example 1 — a first encounter with QP (framework)

Start with the simplest possible case. Write down what QP (framework) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to QP (framework) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about QP (framework) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of QP (framework)

In research
QP (framework) appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses QP (framework) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
QP (framework) is common in secondary-school and first-year university syllabi. It links to neighbouring topics Cross-platform software, Embedded Linux, Embedded operating systems, so understanding it makes those chapters shorter.
In everyday life
Look for QP (framework) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study QP (framework) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what QP (framework) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain QP (framework) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is QP (framework) in simple terms?

QP (Quantum Platform) is a family of open source real-time embedded frameworks (RTEFs) and runtime environments based on active objects (actors) and hierarchical state machines (UML statecharts). The QP family consists of the lightweight QP/C and QP/C++ frameworks, written in C (C99) and C++ (C++11…

Why does QP (framework) matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study QP (framework)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on QP (framework).

Tags

  • Cross-platform software
  • Embedded Linux
  • Embedded operating systems
  • Free software operating systems
  • Free software programmed in C++
  • Object-oriented programming
  • Programming tools for Windows
  • Real-time operating systems
  • Software architecture
  • Software using the GNU General Public License

Keep exploring