Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
api:thread:zh [2023/10/20 11:14]
hfsr [Event Registration Independence]
api:thread:zh [2023/10/20 11:18]
hfsr [Overview]
Line 26: Line 26:
   * 被推送的事件对系统中的所有运行中线程可见。   * 被推送的事件对系统中的所有运行中线程可见。
   * 两个独立的线程可以对同一个事件`event.pull`,每个线程都会独立观测到此事件。   * 两个独立的线程可以对同一个事件`event.pull`,每个线程都会独立观测到此事件。
-===== Overview ​=====+===== 概述 ​=====
  
-There are two main use cases for using threads over other viable options+线程主要有两种用途是其他选择无法提供:
  
-You want to write a function that makes blocking calls without blocking the rest of your application. +你需要编写一个函数,其中进行了阻塞式调用,但不阻塞程序其它部分的运行。 
-You want a long running background function without having to manage yielding and resuming it manually.+你需要编写长期运行的后台函数,而不想手动管理其yield与resum。
  
 ===== Functions ===== ===== Functions =====