请输入您要查询的百科知识:

 

词条 Yield (multithreading)
释义

  1. Examples

  2. In coroutines

  3. See also

  4. References

In computer science, yield is an action that occurs in a computer program during multithreading, of forcing a processor to relinquish control of the current running thread, and sending it to the end of the running queue, of the same scheduling priority.

Examples

Different programming languages implement yielding in various ways.

  • pthread_yield() in the language C, a low level implementation, provided by POSIX Threads[1]
  • std::this_thread::yield() in the language C++, introduced in C++11.
  • The Yield method is provided in various object-oriented programming languages with multithreading support, such as C# and Java.[2] OOP languages generally provide class abstractions for thread objects.

In coroutines

Coroutines are a fine-grained concurrency primitive, which may be required to yield explicitly. They may enable specifying another function to take control. Coroutines that explicitly yield allow cooperative multitasking.

See also

  • Coroutines
  • Java (software platform)
  • Common Language Runtime
  • Java virtual machine
  • Actor model

References

1. ^{{cite web|title=pthread_yield|url=https://www.ibm.com/support/knowledgecenter/#!/SSLTBW_2.1.0/com.ibm.zos.v2r1.bpxbd00/ptyield.htm}}
2. ^{{cite web|url=http://www.javamex.com/tutorials/threads/yield.shtml|title=Thread.yield|publisher=Javamex|accessdate=24 June 2011}}
{{Parallel Computing}}{{Portal|Java (programming language)}}{{DEFAULTSORT:Yield method}}

8 : Operating system technology|Concurrent computing|Threads (computing)|Java platform|Computing platforms|Compiler optimizations|Software optimization|Method (computer programming)

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/9/23 3:11:18