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

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值