计算机专业外文翻译 急

来源:百度知道 编辑:UC知道 时间:2024/05/06 23:55:15
不要直接用软件翻译 要符合计算机专业知识的翻译 急 多谢
Deadlock
Deadlock is illustrated by the classic, if somewhat unsanitary, "dining philosophers" problem. Five philosophers go out for Chinese food and are seated at a circular table. There are five chopsticks (not five pairs), one placed between each pair of diners. The philosophers alternate between thinking and eating. Each needs to acquire two chopsticks for long enough to eat, but can then put the chopsticks back and return to thinking. There are some chopstick-management algorithms that let everyone eat on a more or less timely basis (a hungry philosopher tries to grab both adjacent chopsticks, but if one is not available, puts down the one that is available and waits a minute or so before trying again), and some that can result in some or all of the philosophers dying of hunger (each philosopher immediately grabs the chopstick to his left and waits for the chopstick to his right to be available before putting down the left). The lat

死锁

死锁可以用一个经典的,某程度上说有点不卫生的“哲学家吃饭”问题来阐述. 5位哲学家外出围在一张桌子上吃中国菜.可那里只有5根筷子(不是5双), 每1根分别放在就餐者与就餐者之间. 哲学家们轮流着思考和吃饭.每人都需要获得2根筷子才能吃饭,然后又放下筷子继续思考问题.现在有个“筷子管理法则”几乎能让每人都可以及时地吃上东西(其中一位饥饿的哲学家试图抢占和自己临近的筷子,但如果他还缺一根, 就放下手头上的那根筷子然后等待大约1分钟后再尝试抢占),这样,就可能会导致某些甚者所有的哲学家都因饥饿而渴望得到筷子的情况了(每位哲学家都快速抢得他左手边的那根筷子,并在他们放下左手边的筷子之前等待他右边的筷子). 最后, 他们每人都占据着一个为其他人所需要的资源,并一直等待其他人所占有的资源,而且又不释放自己所占据的,直到获得了自己所没有的资源.这就是死锁的阐述了.

当一个线程一直占据着一个锁,那么其他试图获得该锁的线程就会陷入一直阻塞等待的状态。当线程A占据锁L并试图获取锁M,但与此同时线程B又占据M而且也试图获取L,那么两个线程就会一直等下去.这种情况就是最简单的死锁了(或者叫“死锁”【翻译者注】英文中“死锁”一词有多种写法,但中文里统一称为“死锁”), 即多个线程因这种循环的锁而一直等待下去. (试想一下,让线程作为有向图的结点,该有向图的边代表“线程A正在等待线程B所占据的资源”的关系.如果该图是循环的,那么这就是一个死锁了.)

【以上绝对是非机器翻译的,“死锁”以前看过了,因为我也是读计算机的哟】