Skip to content

Commit

Permalink
Add SCHED_DEADLINE, SCHED_NORMAL constants to os module
Browse files Browse the repository at this point in the history
  • Loading branch information
rruuaanng committed Dec 6, 2024
1 parent d9331f1 commit cd8e65a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Doc/library/os.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5420,10 +5420,22 @@ operating system.
Scheduling policy for CPU-intensive processes that tries to preserve
interactivity on the rest of the computer.

.. data:: SCHED_DEADLINE

Scheduling strategies for tasks with real-time constraints.

.. versionadded:: next

.. data:: SCHED_IDLE

Scheduling policy for extremely low priority background tasks.

.. data:: SCHED_NORMAL

Alias for :data:`SCHED_OTHER`.

.. versionadded:: next

.. data:: SCHED_SPORADIC

Scheduling policy for sporadic server programs.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add the ``SCHED_DEADLINE`` and ``SCHED_NORMAL`` constants to the :mod:`os` module.
6 changes: 6 additions & 0 deletions Modules/posixmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -17500,9 +17500,15 @@ all_ins(PyObject *m)
#ifdef SCHED_OTHER
if (PyModule_AddIntMacro(m, SCHED_OTHER)) return -1;
#endif
#ifdef SCHED_DEADLINE
if (PyModule_AddIntMacro(m, SCHED_DEADLINE)) return -1;
#endif
#ifdef SCHED_FIFO
if (PyModule_AddIntMacro(m, SCHED_FIFO)) return -1;
#endif
#ifdef SCHED_NORMAL
if (PyModule_AddIntMacro(m, SCHED_NORMAL)) return -1;
#endif
#ifdef SCHED_RR
if (PyModule_AddIntMacro(m, SCHED_RR)) return -1;
#endif
Expand Down

0 comments on commit cd8e65a

Please sign in to comment.