日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

装逼的翻译,害死多少人,你同意吗?到底什么是非终止状态,终止状态

發布時間:2023/12/18 编程问答 47 豆豆
生活随笔 收集整理的這篇文章主要介紹了 装逼的翻译,害死多少人,你同意吗?到底什么是非终止状态,终止状态 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

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

總結

以上是生活随笔為你收集整理的装逼的翻译,害死多少人,你同意吗?到底什么是非终止状态,终止状态的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。