Rechercher

Ce contenu n'est pas disponible dans la langue sélectionnée.

Chapter 13. System calls in RHEL for Real Time

download PDF

The real-time system call is a function used by application programs to communicate with the kernel. It is a mechanism for programs to order resources from the kernel.

13.1. sched_yield() function

The sched_yield() function is designed for a processor to select a process other than the running one. This type of request is prone to failure when issued from within a poorly-written application.

When the sched_yield() function is used within processes with real-time priorities, it can display unexpected behavior. The process that calls sched_yield() moves to the tail of the queue of processes running at same priority. When there are no other processes running at the same priority, the process that called sched_yield() continues to run. If the priority of that process is high, it can potentially create a busy loop, rendering the machine unusable.

In general, do not use sched_yield() on real-time processes.

13.2. getrusage() function

The getrusage() function retrieves important information from a specified process or its threads. It reports on information such as:

  • The number of voluntary and involuntary context switches.
  • Major and minor page faults.
  • Amount of memory in use.

getrusage() enables you to query an application to provide information relevant to both performance tuning and debugging activities. getrusage() retrieves information that would otherwise need to be cataloged from several different files in the /proc/ directory and would be hard to synchronize with specific actions or events on the application.

Note

Not all the fields contained in the structure filled with getrusage() results are set by the kernel. Some of them are kept for compatibility reasons only.

Additional resources

  • getrusage(2) man page
Red Hat logoGithubRedditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez leBlog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

© 2024 Red Hat, Inc.