装逼的翻译,害死多少人,你同意吗?到底什么是非终止状态,终止状态
http://msdn.microsoft.com/zh-cn/library/system.threading.autoresetevent.aspx
http://msdn.microsoft.com/en-us/library/system.threading.autoresetevent.aspx
很久以前對這段翻譯就很不爽了,為啥一直都要把non-signaled的翻譯成“非終止狀態”,為啥TMD就不可以翻譯成“無信號量狀態”,把signaled非得叫啥“終止狀態”,直接翻成“有信號量的狀態”不是更好嗎。
AutoResetEvent?allows threads to communicate with each other by signaling. Typically, you use this class when threads need exclusive access to a resource.
A thread waits for a signal by calling?WaitOne?on the?AutoResetEvent. If the?AutoResetEvent?is in the non-signaled state, the thread blocks, waiting for the thread that currently controls the resource to signal that the resource is available by calling?Set.
Calling?Set?signals?AutoResetEvent?to release a waiting thread.?AutoResetEvent?remains signaled until a single waiting thread is released, and then automatically returns to the non-signaled state. If no threads are waiting, the state remains signaled indefinitely.
If a thread calls?WaitOne?while the?AutoResetEvent?is in the signaled state, the thread does not block. The?AutoResetEvent?releases the thread immediately and returns to the non-signaled state.
中文翻譯
AutoResetEvent?允許線程通過發信號互相通信。?通常,當線程需要獨占訪問資源時使用該類。
線程通過調用?AutoResetEvent?上的?WaitOne?來等待信號。?如果?AutoResetEvent?為非終止狀態,則線程會被阻止,并等待當前控制資源的線程通過調用?Set來通知資源可用。
調用?Set?向?AutoResetEvent?發信號以釋放等待線程。?AutoResetEvent?將保持終止狀態,直到一個正在等待的線程被釋放,然后自動返回非終止狀態。?如果沒有任何線程在等待,則狀態將無限期地保持為終止狀態。
如果當?AutoResetEvent?為終止狀態時線程調用?WaitOne,則線程不會被阻止。?AutoResetEvent?將立即釋放線程并返回到非終止狀態。
?
其實,從英文字面意思上真的事很容易理解的東西。翻譯過來之后讀起來都TMD拗口。
可以嘗試用我字面意思替換上面的紅色字體,理解起來真的十分簡單!!!
轉載于:https://www.cnblogs.com/shineqiujuan/p/3281508.html
總結
以上是生活随笔為你收集整理的装逼的翻译,害死多少人,你同意吗?到底什么是非终止状态,终止状态的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: pipline中替换tag变量
- 下一篇: CSDN社区之星专訪:我的蜕变之路