亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? pthread_cond_broadcast.html

?? posix標準英文,html格式
?? HTML
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta name="generator" content="HTML Tidy, see www.w3.org"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 --><!-- Copyright (c) 2001-2004 IEEE and The Open Group, All Rights Reserved --><title>pthread_cond_broadcast</title></head><body bgcolor="white"><script type="text/javascript" language="JavaScript" src="../jscript/codes.js"></script><basefont size="3"> <a name="pthread_cond_broadcast"></a> <a name="tag_03_515"></a><!-- pthread_cond_broadcast --> <!--header start--><center><font size="2">The Open Group Base Specifications Issue 6<br>IEEE Std 1003.1, 2004 Edition<br>Copyright &copy; 2001-2004 The IEEE and The Open Group, All Rights reserved.</font></center><!--header end--><hr size="2" noshade><h4><a name="tag_03_515_01"></a>NAME</h4><blockquote>pthread_cond_broadcast, pthread_cond_signal - broadcast or signal a condition</blockquote><h4><a name="tag_03_515_02"></a>SYNOPSIS</h4><blockquote class="synopsis"><div class="box"><code><tt><sup>[<a href="javascript:open_code('THR')">THR</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> #include &lt;<a href="../basedefs/pthread.h.html">pthread.h</a>&gt;<br><br> int pthread_cond_broadcast(pthread_cond_t *</tt><i>cond</i><tt>);<br> int pthread_cond_signal(pthread_cond_t *</tt><i>cond</i><tt>); <img src="../images/opt-end.gif" alt="[Option End]" border="0"></tt></code></div><tt><br></tt></blockquote><h4><a name="tag_03_515_03"></a>DESCRIPTION</h4><blockquote><p>These functions shall unblock threads blocked on a condition variable.</p><p>The <i>pthread_cond_broadcast</i>() function shall unblock all threads currently blocked on the specified condition variable<i>cond</i>.</p><p>The <i>pthread_cond_signal</i>() function shall unblock at least one of the threads that are blocked on the specified conditionvariable <i>cond</i> (if any threads are blocked on <i>cond</i>).</p><p>If more than one thread is blocked on a condition variable, the scheduling policy shall determine the order in which threads areunblocked. When each thread unblocked as a result of a <i>pthread_cond_broadcast</i>() or <i>pthread_cond_signal</i>() returns fromits call to <a href="../functions/pthread_cond_wait.html"><i>pthread_cond_wait</i>()</a> or <a href="../functions/pthread_cond_timedwait.html"><i>pthread_cond_timedwait</i>()</a>, the thread shall own the mutex with which it called<a href="../functions/pthread_cond_wait.html"><i>pthread_cond_wait</i>()</a> or <a href="../functions/pthread_cond_timedwait.html"><i>pthread_cond_timedwait</i>()</a>. The thread(s) that are unblocked shall contend forthe mutex according to the scheduling policy (if applicable), and as if each had called <a href="../functions/pthread_mutex_lock.html"><i>pthread_mutex_lock</i>()</a>.</p><p>The <i>pthread_cond_broadcast</i>() or <i>pthread_cond_signal</i>() functions may be called by a thread whether or not itcurrently owns the mutex that threads calling <a href="../functions/pthread_cond_wait.html"><i>pthread_cond_wait</i>()</a> or <ahref="../functions/pthread_cond_timedwait.html"><i>pthread_cond_timedwait</i>()</a> have associated with the condition variableduring their waits; however, if predictable scheduling behavior is required, then that mutex shall be locked by the thread calling<i>pthread_cond_broadcast</i>() or <i>pthread_cond_signal</i>().</p><p>The <i>pthread_cond_broadcast</i>() and <i>pthread_cond_signal</i>() functions shall have no effect if there are no threadscurrently blocked on <i>cond</i>.</p></blockquote><h4><a name="tag_03_515_04"></a>RETURN VALUE</h4><blockquote><p>If successful, the <i>pthread_cond_broadcast</i>() and <i>pthread_cond_signal</i>() functions shall return zero; otherwise, anerror number shall be returned to indicate the error.</p></blockquote><h4><a name="tag_03_515_05"></a>ERRORS</h4><blockquote><p>The <i>pthread_cond_broadcast</i>() and <i>pthread_cond_signal</i>() function may fail if:</p><dl compact><dt>[EINVAL]</dt><dd>The value <i>cond</i> does not refer to an initialized condition variable.</dd></dl><p>These functions shall not return an error code of [EINTR].</p></blockquote><hr><div class="box"><em>The following sections are informative.</em></div><h4><a name="tag_03_515_06"></a>EXAMPLES</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_515_07"></a>APPLICATION USAGE</h4><blockquote><p>The <i>pthread_cond_broadcast</i>() function is used whenever the shared-variable state has been changed in a way that more thanone thread can proceed with its task. Consider a single producer/multiple consumer problem, where the producer can insert multipleitems on a list that is accessed one item at a time by the consumers. By calling the <i>pthread_cond_broadcast</i>() function, theproducer would notify all consumers that might be waiting, and thereby the application would receive more throughput on amulti-processor. In addition, <i>pthread_cond_broadcast</i>() makes it easier to implement a read-write lock. The<i>pthread_cond_broadcast</i>() function is needed in order to wake up all waiting readers when a writer releases its lock.Finally, the two-phase commit algorithm can use this broadcast function to notify all clients of an impending transactioncommit.</p><p>It is not safe to use the <i>pthread_cond_signal</i>() function in a signal handler that is invoked asynchronously. Even if itwere safe, there would still be a race between the test of the Boolean <a href="../functions/pthread_cond_wait.html"><i>pthread_cond_wait</i>()</a> that could not be efficiently eliminated.</p><p>Mutexes and condition variables are thus not suitable for releasing a waiting thread by signaling from code running in a signalhandler.</p></blockquote><h4><a name="tag_03_515_08"></a>RATIONALE</h4><blockquote><h5><a name="tag_03_515_08_01"></a>Multiple Awakenings by Condition Signal</h5><p>On a multi-processor, it may be impossible for an implementation of <i>pthread_cond_signal</i>() to avoid the unblocking of morethan one thread blocked on a condition variable. For example, consider the following partial implementation of <a href="../functions/pthread_cond_wait.html"><i>pthread_cond_wait</i>()</a> and <i>pthread_cond_signal</i>(), executed by two threads inthe order given. One thread is trying to wait on the condition variable, another is concurrently executing<i>pthread_cond_signal</i>(), while a third thread is already waiting.</p><pre><tt>pthread_cond_wait(mutex, cond):    value = cond-&gt;value; /* 1 */    pthread_mutex_unlock(mutex); /* 2 */    pthread_mutex_lock(cond-&gt;mutex); /* 10 */    if (value == cond-&gt;value) { /* 11 */        me-&gt;next_cond = cond-&gt;waiter;        cond-&gt;waiter = me;        pthread_mutex_unlock(cond-&gt;mutex);        unable_to_run(me);    } else        pthread_mutex_unlock(cond-&gt;mutex); /* 12 */    pthread_mutex_lock(mutex); /* 13 */<br>pthread_cond_signal(cond):    pthread_mutex_lock(cond-&gt;mutex); /* 3 */    cond-&gt;value++; /* 4 */    if (cond-&gt;waiter) { /* 5 */        sleeper = cond-&gt;waiter; /* 6 */        cond-&gt;waiter = sleeper-&gt;next_cond; /* 7 */        able_to_run(sleeper); /* 8 */    }    pthread_mutex_unlock(cond-&gt;mutex); /* 9 */</tt></pre><p>The effect is that more than one thread can return from its call to <a href="../functions/pthread_cond_wait.html"><i>pthread_cond_wait</i>()</a> or <a href="../functions/pthread_cond_timedwait.html"><i>pthread_cond_timedwait</i>()</a> as a result of one call to<i>pthread_cond_signal</i>(). This effect is called &quot;spurious wakeup&quot;. Note that the situation is self-correcting in that thenumber of threads that are so awakened is finite; for example, the next thread to call <a href="../functions/pthread_cond_wait.html"><i>pthread_cond_wait</i>()</a> after the sequence of events above blocks.</p><p>While this problem could be resolved, the loss of efficiency for a fringe condition that occurs only rarely is unacceptable,especially given that one has to check the predicate associated with a condition variable anyway. Correcting this problem wouldunnecessarily reduce the degree of concurrency in this basic building block for all higher-level synchronization operations.</p><p>An added benefit of allowing spurious wakeups is that applications are forced to code a predicate-testing-loop around thecondition wait. This also makes the application tolerate superfluous condition broadcasts or signals on the same condition variablethat may be coded in some other part of the application. The resulting applications are thus more robust. Therefore,IEEE&nbsp;Std&nbsp;1003.1-2001 explicitly documents that spurious wakeups may occur.</p></blockquote><h4><a name="tag_03_515_09"></a>FUTURE DIRECTIONS</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_515_10"></a>SEE ALSO</h4><blockquote><p><a href="pthread_cond_destroy.html"><i>pthread_cond_destroy</i>()</a>, <a href="pthread_cond_timedwait.html"><i>pthread_cond_timedwait</i>()</a>, the Base Definitions volume of IEEE&nbsp;Std&nbsp;1003.1-2001,<a href="../basedefs/pthread.h.html"><i>&lt;pthread.h&gt;</i></a></p></blockquote><h4><a name="tag_03_515_11"></a>CHANGE HISTORY</h4><blockquote><p>First released in Issue 5. Included for alignment with the POSIX Threads Extension.</p></blockquote><h4><a name="tag_03_515_12"></a>Issue 6</h4><blockquote><p>The <i>pthread_cond_broadcast</i>() and <i>pthread_cond_signal</i>() functions are marked as part of the Threads option.</p><p>The APPLICATION USAGE section is added.</p></blockquote><div class="box"><em>End of informative text.</em></div><hr size="2" noshade><center><font size="2"><!--footer start-->UNIX &reg; is a registered Trademark of The Open Group.<br>POSIX &reg; is a registered Trademark of The IEEE.<br>[ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../functions/contents.html">XSH</a> | <a href="../xrat/contents.html">XRAT</a>]</font></center><!--footer end--><hr size="2" noshade></body></html>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品无人码麻豆乱码1区2区 | 亚洲欧美在线另类| 亚洲人成精品久久久久久| 专区另类欧美日韩| 青青草原综合久久大伊人精品优势| 激情成人午夜视频| 91成人网在线| 久久综合色之久久综合| 亚洲欧美一区二区视频| 色婷婷综合久久久中文字幕| 日韩限制级电影在线观看| 国产精品久久久久久久久果冻传媒| 亚洲一区二区三区爽爽爽爽爽| 毛片一区二区三区| 色乱码一区二区三区88| 亚洲国产日产av| www.亚洲人| 日韩欧美另类在线| 亚洲成人精品影院| 91在线丨porny丨国产| 久久一区二区三区国产精品| 国产黄色91视频| 日韩女优视频免费观看| 成人亚洲一区二区一| 日韩精品资源二区在线| 国产成人一级电影| 亚洲精品免费看| 91欧美一区二区| 国产精品五月天| 国产69精品久久久久777| 日韩欧美高清一区| 成人伦理片在线| 日韩制服丝袜av| 欧美剧在线免费观看网站| 中文字幕在线不卡一区 | 五月天网站亚洲| 欧美日韩不卡一区| 亚洲成人精品一区| 久久久一区二区| 国产成人亚洲综合色影视| 亚洲人成网站色在线观看 | 91精品国产一区二区三区| 亚洲一二三区视频在线观看| 欧美电影精品一区二区| 日本韩国欧美国产| 国产另类ts人妖一区二区| 国产亚洲一本大道中文在线| 免费视频一区二区| 亚洲色图欧美在线| 2024国产精品视频| 欧美丰满少妇xxxxx高潮对白| 国v精品久久久网| 蜜臀av在线播放一区二区三区| 中文字幕日韩精品一区 | 国产精品99久久久久久宅男| 亚洲第一搞黄网站| 亚洲六月丁香色婷婷综合久久 | 99免费精品视频| 国产高清成人在线| 老司机一区二区| 日本一区二区三区dvd视频在线| 成人av电影免费观看| 亚洲综合男人的天堂| 中文字幕欧美国产| 色呦呦日韩精品| 成人h版在线观看| 国产激情视频一区二区三区欧美 | 亚洲素人一区二区| 中文字幕中文字幕在线一区 | 午夜在线成人av| 亚洲综合色自拍一区| 国产情人综合久久777777| 日韩欧美第一区| 日韩免费看的电影| 日韩欧美不卡在线观看视频| 欧美日韩国产一区二区三区地区| 一本色道**综合亚洲精品蜜桃冫| 菠萝蜜视频在线观看一区| 高清国产一区二区| 国产成人在线免费| 国产成人免费高清| 国产高清精品久久久久| 国产盗摄女厕一区二区三区| 国产一区二区三区av电影| 国产精品久久久久7777按摩| 国产精品久久一卡二卡| 成人欧美一区二区三区视频网页 | 一本色道a无线码一区v| 色av成人天堂桃色av| 欧美影院一区二区| 国产乱子伦视频一区二区三区| 久久成人羞羞网站| 国产精品中文有码| 99re热视频这里只精品| 在线观看日韩国产| 成人性色生活片免费看爆迷你毛片| 激情伊人五月天久久综合| 国产老肥熟一区二区三区| 丁香婷婷深情五月亚洲| 99精品久久只有精品| 欧美最猛性xxxxx直播| 91超碰这里只有精品国产| 99国产精品久久久久久久久久久 | 国产成人免费视频网站| 91偷拍与自偷拍精品| 欧美日韩三级视频| 91丨porny丨在线| 在线一区二区视频| 精品国产污网站| 4438x成人网最大色成网站| 日韩一区二区三区视频在线观看| 亚洲精品一线二线三线无人区| 欧美国产综合色视频| 亚洲国产视频一区| 国产精品91xxx| 91福利小视频| 欧美大胆人体bbbb| 亚洲三级免费观看| 麻豆免费看一区二区三区| 成人在线视频首页| 91精品国产综合久久婷婷香蕉| 久久久天堂av| 丝袜亚洲另类欧美| 懂色av中文字幕一区二区三区| 欧美日韩在线播| 久久久国产精品不卡| 午夜久久电影网| 东方aⅴ免费观看久久av| 欧美日韩一区视频| 中文字幕中文在线不卡住| 日本成人在线不卡视频| 日韩精品国产精品| 成人影视亚洲图片在线| 欧美区一区二区三区| 中文无字幕一区二区三区 | 国产精品久久久久久久久搜平片| 亚洲电影第三页| 99久久综合国产精品| 日韩精品一区二区三区四区视频 | 亚洲天堂精品在线观看| 九一九一国产精品| 欧美午夜一区二区三区| 日本一区二区三区高清不卡| 日韩av电影一区| 91国偷自产一区二区三区成为亚洲经典 | 国产91精品一区二区麻豆网站 | 亚洲激情av在线| 成人伦理片在线| 国产色一区二区| 久88久久88久久久| 欧美一区二区三区色| 一区二区三区中文字幕在线观看| 亚洲国产欧美一区二区三区丁香婷| 成人手机在线视频| 欧美精品一区二区久久婷婷| 丝瓜av网站精品一区二区| 色婷婷狠狠综合| 亚洲欧美视频在线观看视频| 国产黄色精品网站| 久久久午夜电影| 国产一区二区三区不卡在线观看| 欧美一级国产精品| 日本成人超碰在线观看| 欧美日韩精品高清| 亚洲电影一级片| 在线播放91灌醉迷j高跟美女 | 亚洲一区二区三区中文字幕在线| 成人ar影院免费观看视频| 久久精品人人做人人爽97| 激情丁香综合五月| 国产日韩欧美麻豆| 成人性色生活片免费看爆迷你毛片| 国产亚洲欧美日韩日本| 国产麻豆精品视频| 亚洲国产精品t66y| 成人动漫中文字幕| 亚洲人成电影网站色mp4| 91视视频在线观看入口直接观看www | 欧美一区二区久久久| 日韩电影在线一区二区| 日韩一区二区三区电影在线观看| 美日韩一区二区三区| 精品少妇一区二区三区在线视频| 国产精品久久久久久久久晋中| 国产91对白在线观看九色| 国产精品视频九色porn| 91亚洲精华国产精华精华液| 亚洲精品高清在线观看| 欧美日韩高清一区| 久久99精品国产91久久来源| 2022国产精品视频| 99久久精品免费看国产| 亚洲综合自拍偷拍| 欧美一级黄色大片| 成人在线一区二区三区| 伊人夜夜躁av伊人久久| 欧美一级久久久久久久大片| 国产成人一区在线| 亚洲国产另类精品专区| 日韩欧美亚洲国产另类|