什么样的循环是(;;)? [英] What kind of loop is for (;;)?

查看:105
本文介绍了什么样的循环是(;;)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

发现在托沃兹/ Linux的2.6.git - >内核/ mutex.c线171

Found in torvalds/linux-2.6.git -> kernel/mutex.c line 171

我试图找到它在谷歌和这样无济于事。

I have tried to find it on Google and such to no avail.

这是什么为(;;)指示?

推荐答案

对于本(;;)是一个无限循环的情况类似,而(1)大多数已经提到。你会更经常地看到这一点,在内核互斥codeS,或如互斥等问题哲学家就餐。直到互斥变量被设置为一个特定的值,使得第二工艺获得对资源的访问,所述第二过程不断循环,也称为忙等待。对资源的访问可以是磁盘访问,为此,2过程中使用的竞争互斥体,使得在同一时间只有一个进程中对资源的访问来访问。

The for(;;) is an infinite loop condition, similar to while(1) as most have already mentioned. You would more often see this, in kernel mutex codes, or mutex eg problem such as dining philosophers. Until the mutex variable is set to a particular value, such that a second process gets access to the resource, the second process keeps on looping, also known as busy wait. Access to a resource can be disk access, for which 2 process are competing to gain access using a mutex such that at a time only one process has the access to the resource.

这篇关于什么样的循环是(;;)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆