OSDN Git Service

Update README
[linuxjm/LDP_man-pages.git] / draft / man2 / sched_yield.2
index 56c4a49..b1f9a89 100644 (file)
@@ -1,7 +1,6 @@
-.\" Hey Emacs! This file is -*- nroff -*- source.
-.\"
 .\" Copyright (C) Tom Bjorkholm & Markus Kuhn, 1996
 .\"
+.\" %%%LICENSE_START(GPLv2+_DOC_FULL)
 .\" This is free documentation; you can redistribute it and/or
 .\" modify it under the terms of the GNU General Public License as
 .\" published by the Free Software Foundation; either version 2 of
 .\" GNU General Public License for more details.
 .\"
 .\" You should have received a copy of the GNU General Public
-.\" License along with this manual; if not, write to the Free
-.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
-.\" USA.
+.\" License along with this manual; if not, see
+.\" <http://www.gnu.org/licenses/>.
+.\" %%%LICENSE_END
 .\"
 .\" 1996-04-01 Tom Bjorkholm <tomb@mydata.se>
 .\"            First version written
 .\" 1996-04-10 Markus Kuhn <mskuhn@cip.informatik.uni-erlangen.de>
 .\"            revision
 .\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
 .\"         all rights reserved.
 .\" Translated Sun Feb 23 22:42:36 JST 1997
 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
 .\" Updated 2008-11-10, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.13
 .\"
-.\"WORD:       yield                   ¶õ¤±ÅϤ¹
-.\"WORD:       block                   ÃæÃÇ(block)
-.\"WORD:       process                 ¥×¥í¥»¥¹
-.\"WORD:       processor               ¥×¥í¥»¥Ã¥µ¡¼
-.\"WORD:       queue                   ¥­¥å¡¼
-.\"WORD:       static                  ÀÅŪ
-.\"WORD:       priority                ¥×¥é¥¤¥ª¥ê¥Æ¥£
-.\"WORD:       scheduling              ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°
-.\"
-.TH SCHED_YIELD 2 2008-10-18 "Linux" "Linux Programmer's Manual"
-.\"O .SH NAME
-.SH Ì¾Á°
-.\"O sched_yield \- yield the processor
-sched_yield \- ¥×¥í¥»¥Ã¥µ¡¼¤ò¶õ¤±ÅϤ¹(yield)
-.\"O .SH SYNOPSIS
-.SH ½ñ¼°
-.B #include <sched.h>
+.TH SCHED_YIELD 2 2014\-04\-28 Linux "Linux Programmer's Manual"
+.SH 名前
+sched_yield \- プロセッサーを空け渡す(yield)
+.SH 書式
+\fB#include <sched.h>\fP
 .sp
-.B int sched_yield(void);
-.\"O .SH DESCRIPTION
-.SH ÀâÌÀ
-.\"O .BR sched_yield ()
-.\"O causes the calling thread to relinquish the CPU.
-.BR sched_yield ()
-¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¡¢¸Æ¤Ó½Ð¤·¤¿¥¹¥ì¥Ã¥É¤¬ CPU ¤Î»ÈÍѸ¢¤ò¼êÊü¤¹¤³¤È¤¬¤Ç¤­¤ë¡£
-.\"O The thread is moved to the end of the queue for its static
-.\"O priority and a new thread gets to run.
-¤½¤Î¥¹¥ì¥Ã¥É¤Ï¡¢¤½¤Î¥¹¥ì¥Ã¥É¤ÎÀÅŪ¥×¥é¥¤¥ª¥ê¥Æ¥£¤Î¥­¥å¡¼¤ÎËöÈø¤Ë
-°ÜÆ°¤·¡¢¿·¤·¤¤¥¹¥ì¥Ã¥É¤¬Áö¤ê»Ï¤á¤ë¡£
-.\"O .SH "RETURN VALUE"
-.SH ÊÖ¤êÃÍ
-.\"O On success,
-.\"O .BR sched_yield ()
-.\"O returns 0.
-.\"O On error, \-1 is returned, and
-.\"O .I errno
-.\"O is set appropriately.
-À®¸ù¤·¤¿¾ì¹ç¤Ï
-.BR sched_yield ()
-¤Ï 0 ¤òÊÖ¤¹¡£
-¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢
-.I errno
-¤¬Å¬ÀÚ¤ËÀßÄꤵ¤ì¤ë¡£
-.\"O .SH ERRORS
-.SH ¥¨¥é¡¼
-.\"O In the Linux implementation,
-.\"O .BR sched_yield ()
-.\"O always succeeds.
-Linux ¤Î¼ÂÁõ¤Ç¤Ï¡¢
-.BR sched_yield ()
-¤Ï¾ï¤ËÀ®¸ù¤¹¤ë¡£
-.\"O .SH "CONFORMING TO"
-.SH ½àµò
-POSIX.1-2001.
-.\"O .SH NOTES
-.SH Ãí°Õ
-.\"O If the calling thread is the only thread in the highest
-.\"O priority list at that time,
-.\"O it will continue to run after a call to
-.\"O .BR sched_yield ().
-.BR sched_yield ()
-¤ò¸Æ¤Ó½Ð¤·¤¿»þÅÀ¤ÇºÇÂçÍ¥ÀèÅ٤Υꥹ¥È¤ÎÃæ¤Ë¸Æ¤Ó½Ð¤·¸µ¤Î¥¹¥ì¥Ã¥É¤·¤«
-¸ºß¤·¤Ê¤±¤ì¤Ð¡¢¤½¤Î¥¹¥ì¥Ã¥É¤Ï¸Æ¤Ó½Ð¤·¸å¤âÁö¤ê³¤±¤ë¤³¤È¤Ë¤Ê¤ë¡£
+\fBint sched_yield(void);\fP
+.SH 説明
+\fBsched_yield\fP()  を呼び出すことで、呼び出したスレッドが CPU の使用権を手放すことができる。
+そのスレッドは、そのスレッドの静的プライオリティのキューの末尾に 移動し、新しいスレッドが走り始める。
+.SH 返り値
+成功した場合は \fBsched_yield\fP()  は 0 を返す。 エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。
+.SH エラー
+Linux の実装では、 \fBsched_yield\fP()  は常に成功する。
+.SH 準拠
+POSIX.1\-2001.
+.SH 注意
+\fBsched_yield\fP()  を呼び出した時点で最大優先度のリストの中に呼び出し元のスレッドしか
+存在しなければ、そのスレッドは呼び出し後も走り続けることになる。
 
-.\"O POSIX systems on which
-.\"O .BR sched_yield ()
-.\"O is available define
-.\"O .B _POSIX_PRIORITY_SCHEDULING
-.\"O in \fI<unistd.h>\fP.
-POSIX ¥·¥¹¥Æ¥à¤Ç
-.BR sched_yield ()
-¤Ï \fI<unistd.h>\fP ¤Ë
-.B _POSIX_PRIORITY_SCHEDULING
-¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Î¤ß»ÈÍѲÄǽ¤Ç¤¢¤ë¡£
+POSIX システムで \fBsched_yield\fP()  は \fI<unistd.h>\fP に
+\fB_POSIX_PRIORITY_SCHEDULING\fP が定義されている場合にのみ使用可能である。
 
-.\"O Strategic calls to
-.\"O .BR sched_yield ()
-.\"O can improve performance by giving other threads or processes
-.\"O a chance to run when (heavily) contended resources (e.g., mutexes)
-.\"O have been released by the caller.
-.\"O Avoid calling
-.\"O .BR sched_yield ()
-.\"O unnecessarily or inappropriately
-.\"O (e.g., when resources needed by other
-.\"O schedulable threads are still held by the caller),
-.\"O since doing so will result in unnecessary context switches,
-.\"O which will degrade system performance.
-.BR sched_yield ()
-¤òÀïάŪ¤Ë¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¡¢(¶ËÅÙ¤Ë) ¶¥¹ç¤¹¤ë¥ê¥½¡¼¥¹ (mutex ¤Ê¤É)
-¤ò¸Æ¤Ó½Ð¤·¸µ¤¬²òÊü¤·¤¿ºÝ¤Ë¾¤Î¥¹¥ì¥Ã¥É¤ä¥×¥í¥»¥¹¤Ë¼Â¹Ôµ¡²ñ¤òÍ¿¤¨¤ë¤³¤È¤Ç¡¢
-À­Ç½¤ò¾å¤²¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
-.BR sched_yield ()
-¤òɬÍפâ¤Ê¤¤¤Î¤Ë¸Æ¤Ó½Ð¤·¤¿¤ê¡¢ÉÔŬÀڤʾìÌÌ (Î㤨¤Ð¡¢Â¾¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°
-ÂоݤȤʤ륹¥ì¥Ã¥É¤¬É¬ÍפȤ¹¤ë¥ê¥½¡¼¥¹¤ò¸Æ¤Ó½Ð¤·¸µ¤¬ÊÝ»ý¤·¤¿¤Þ¤Þ¤Î¾õÂÖ)
-¤Ç¸Æ¤Ó½Ð¤·¤¿¤ê¤¹¤ë¤Î¤ÏÈò¤±¤ë¤³¤È¡£¤Ê¤¼¤Ê¤é¡¢
-.BR sched_yield ()
-¤Î¸Æ¤Ó½Ð¤·¤è¤êÉÔɬÍפʥ³¥ó¥Æ¥­¥¹¥È¥¹¥¤¥Ã¥Á¤¬µ¯¤³¤ê¡¢¥·¥¹¥Æ¥àÀ­Ç½¤¬
-Îô²½¤¹¤ë·ë²Ì¤Ë¤Ê¤ë¤«¤é¤Ç¤¢¤ë¡£
-.\"O .SH "SEE ALSO"
-.SH ´ØÏ¢¹àÌÜ
-.\"O .BR sched_setscheduler (2)
-.\"O for a description of Linux scheduling.
-Linux ¤Î¥¹¥±¡¼¥¸¥å¥ê¥ó¥°(scheduling)¤Ë¤Ä¤¤¤Æ¤Ï
-.BR sched_setscheduler (2)
-¤ò»²¾È¤»¤è¡£
-.PP
-.I Programming for the real world \- POSIX.4
-by Bill O. Gallmeister, O'Reilly & Associates, Inc., ISBN 1-56592-074-0
+\fBsched_yield\fP()  を戦略的に呼び出すことで、(極度に) 競合するリソース (mutex など)
+を呼び出し元が解放した際に他のスレッドやプロセスに実行機会を与えることで、 性能を上げることができる。 \fBsched_yield\fP()
+を必要もないのに呼び出したり、不適切な場面 (例えば、他のスケジューリング 対象となるスレッドが必要とするリソースを呼び出し元が保持したままの状態)
+で呼び出したりするのは避けること。なぜなら、 \fBsched_yield\fP()  の呼び出しより不必要なコンテキストスイッチが起こり、システム性能が
+劣化する結果になるからである。
+.SH 関連項目
+\fBsched\fP(7)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。