RTOS Linux에서 Process 우선순위

littlez의 이미지

RTOS (Monta Vista Linux)에서 돌아가는
프로세스의 우선순위를 변경 하여
Realtime으로 특정 펑션을 실행 하고자 합니다.
SCHED_FIFO 라고 하나요?
어떻게 특정 프로세스가 돌면서 자기 자신의
priority를 변경 할 수 있나요?
펑션의 실행 시간은 수백 millisecond 입니다.
임베디드 시스템내에서 해당 시간에 꼭 이루어 져야되는
다른 프로세스들은 없다고 판단 됩니다.
해당 process의 priority를 Realtime에 최우선으로
설정 하는 예제를 보여 주셨으면 좋겠습니다.

bushi의 이미지

우선순위

[bushi@rose mach-omap2]$ man -k priority
PRIO [tc-prio]       (8)  - Priority qdisc
getpriority          (2)  - get/set program scheduling priority
getpriority          (3p)  - get and set the nice value
glPrioritizeTextures (3gl)  - set texture residence priority
gnutls_certificate_type_set_priority (3)  - Sets the priority on the certificate types supported by gnutls
gnutls_cipher_set_priority (3)  - Sets the priority on the ciphers supported by gnutls
gnutls_compression_set_priority (3)  - Sets the priority on the compression algorithms supported by gnutls
gnutls_kx_set_priority (3)  - Sets the priority on the key exchange algorithms supported by gnutls
gnutls_mac_set_priority (3)  - Sets the priority on the mac algorithms supported by gnutls
gnutls_protocol_set_priority (3)  - Sets the priority on the protocol versions supported by gnutls
gnutls_set_default_export_priority (3)  - Sets some default priority on the cipher suites supported by gnutls
gnutls_set_default_priority (3)  - Sets some default priority on the cipher suites supported by gnutls
ionice               (1)  - get/set program io scheduling class and priority
ioprio_get [ioprio_set] (2)  - get/set I/O scheduling class and priority
ioprio_set           (2)  - get/set I/O scheduling class and priority
mpath_prio_alua      (8)  - Path priority tool based on Asymmetric LUn Access
nice                 (1)  - run a program with modified scheduling priority
nice                 (2)  - change process priority
pthread_mutex_getprioceiling (3p)  - get and set the priority ceiling of a mutex (REALTIME THREADS)
pthread_mutex_setprioceiling [pthread_mutex_getprioceiling] (3p)  - get and set the priority ceiling of a mutex (REALTIME THREADS)
renice               (1)  - alter priority of running processes
sched_get_priority_max (2)  - get static priority range
sched_get_priority_max (3p)  - get priority limits (REALTIME)
sched_get_priority_min [sched_get_priority_max] (2)  - get static priority range
sched_get_priority_min [sched_get_priority_max] (3p)  - get priority limits (REALTIME)
setlogmask           (3)  - set log priority mask
setpriority [getpriority] (2)  - get/set program scheduling priority
setpriority [getpriority] (3p)  - get and set the nice value
[bushi@rose mach-omap2]$

스케쥴 정책.

[bushi@rose mach-omap2]$ man -k sched
CPU_CLR [sched_setaffinity] (2)  - set and get a process's CPU affinity mask
CPU_ISSET [sched_setaffinity] (2)  - set and get a process's CPU affinity mask
CPU_SET [sched_setaffinity] (2)  - set and get a process's CPU affinity mask
CPU_ZERO [sched_setaffinity] (2)  - set and get a process's CPU affinity mask
DES_key_sched [des]  (3ssl)  - DES encryption
alarm                (3p)  - schedule an alarm signal
batch                (1p)  - schedule commands to be executed in a batch queue
cron                 (8)  - daemon to execute scheduled commands (ISC Cron V4.1)
crontab              (1p)  - schedule periodic background work
crontabs            (rpm) - Root crontab files used to schedule the execution of programs
getpriority          (2)  - get/set program scheduling priority
gpilot-install-file  (1)  - gnome-pilot file conduit scheduler
ionice               (1)  - get/set program io scheduling class and priority
ioprio_get [ioprio_set] (2)  - get/set I/O scheduling class and priority
ioprio_set           (2)  - get/set I/O scheduling class and priority
nice                 (1)  - run a program with modified scheduling priority
posix_spawnattr_getschedparam (3p)  - get and set the spawn-schedparam attribute of a spawn attributes object (ADVANCED REALTIME)
posix_spawnattr_getschedpolicy (3p)  - get and set the spawn-schedpolicy attribute of a spawn attributes object (ADVANCED REALTIME)
posix_spawnattr_setschedparam [posix_spawnattr_getschedparam] (3p)  - get and set the spawn-schedparam attribute of a spawn attributes object (ADVANCED REALTIME)
posix_spawnattr_setschedpolicy [posix_spawnattr_getschedpolicy] (3p)  - get and set the spawn-schedpolicy attribute of a spawn attributes object (ADVANCED REALTIME)
pthread_attr_getinheritsched (3p)  - get and set the inheritsched attribute (REALTIME THREADS)
pthread_attr_getschedparam (3p)  - get and set the schedparam attribute
pthread_attr_getschedpolicy (3p)  - get and set the schedpolicy attribute (REALTIME THREADS)
pthread_attr_setinheritsched [pthread_attr_getinheritsched] (3p)  - get and set the inheritsched attribute (REALTIME THREADS)
pthread_attr_setschedparam [pthread_attr_getschedparam] (3p)  - get and set the schedparam attribute
pthread_attr_setschedpolicy [pthread_attr_getschedpolicy] (3p)  - get and set the schedpolicy attribute (REALTIME THREADS)
pthread_getschedparam (3p)  - dynamic thread scheduling parameters access (REALTIME THREADS)
pthread_setschedparam [pthread_getschedparam] (3p)  - dynamic thread scheduling parameters access (REALTIME THREADS)
pthread_setschedprio (3p)  - dynamic thread scheduling parameters access (REALTIME THREADS)
sched.h [sched]      (0p)  - execution scheduling (REALTIME)
sched_get_priority_max (2)  - get static priority range
sched_get_priority_max (3p)  - get priority limits (REALTIME)
sched_get_priority_min [sched_get_priority_max] (2)  - get static priority range
sched_get_priority_min [sched_get_priority_max] (3p)  - get priority limits (REALTIME)
sched_getaffinity [sched_setaffinity] (2)  - set and get a process's CPU affinity mask
sched_getparam       (3p)  - get scheduling parameters (REALTIME)
sched_getparam [sched_setparam] (2)  - set and get scheduling parameters
sched_getscheduler   (3p)  - get scheduling policy (REALTIME)
sched_getscheduler [sched_setscheduler] (2)  - set and get scheduling algorithm/parameters
sched_rr_get_interval (2)  - get the SCHED_RR interval for the named process
sched_rr_get_interval (3p)  - get execution time limits (REALTIME)
sched_setaffinity    (2)  - set and get a process's CPU affinity mask
sched_setparam       (2)  - set and get scheduling parameters
sched_setparam       (3p)  - set scheduling parameters (REALTIME)
sched_setscheduler   (2)  - set and get scheduling algorithm/parameters
sched_setscheduler   (3p)  - set scheduling policy and parameters (REALTIME)
sched_yield          (2)  - yield the processor
sched_yield          (3p)  - yield the processor
setpriority [getpriority] (2)  - get/set program scheduling priority
stapprobes.iosched [stapprobes] (5)  - systemtap IO scheduler probe points
sync                 (3p)  - schedule file system updates
ualarm               (3)  - schedule signal after given number of microseconds
[bushi@rose mach-omap2]$

OTL

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.