问题 问答题

考虑由n个进程共享的具有m个同类资源的系统,证明:如果对i=1,2,…,n,有Need>0而且所有最大需求量之和小于m+n,那么该系统是死锁无关的。

答案

参考答案:设每个进程对共享资源的最大需求量为x(0<x≤m),由于每个进程最多申请使用x个资源,在最坏的情况下,每个进程都得到了(x-1)个资源i并且都需申请最后一个资源。这时系统剩余资源数为:m-n(x-1)。只要系统还有一个资源可用,就可使其中的一个进程获得所需的全部资源。该进程运行结束后释放出它所占用的资源,其他进程的资源需求也可全部得到满足。因此,当m-m(x-1)≥1时,即x≤(m+n-1)/n时系统不会发生死锁。进而可得系统中所有进程的最大需求量之和n·x≤(m+n-1)时系统不会发生死锁。该题中,所有进程最大需求量之和小于m+n,所以,该系统是死锁无关的。

材料分析题
问答题

American Thanksgivings According to tradition, the first American Thanksgiving was celebrated in 1621 by the English Pilgrims who had founded the Plymouth Colony, now in the state of Massachusetts. The an important part of American colonial history, there is no evidence that any of the participants thought of the feast as a thanksgiving celebration. Two years later, during a period of drought, a day of fasting and prayer was changed to one of thanksgiving because rains came during the prayers. Gradually the custom prevailed among New Englanders to annually celebrate Thanksgiving after the harvest. Colonial governments and, later, state governments took up the Puritan custom of designating thanksgiving days to commemorate various public events. Gradually the tradition of holding annual thanksgiving holidays spread throughout New England and into other states. During the American Revolution (1775—1783 ) the Continental Congress proclaimed a national day of thanksgiving following the American victory at the Baffle of Saratoga in 1777.U.S. President George Washington proclaimed another day of thanksgiving in 1789 in honor of the ratification of the Constitution of the United States. In 1817 New York State adopted Thanksgiving Day as an annual custom, and many other states soon did the same. Most of the state celebrations were held in November, but not always on the same day. In 1863, during the American Civil War (1861—1865 ), President Abraham Lincoln proclaimed the last Thursday in November Thanksgiving Day in order to bolster the Union’s morale. After the war, Congress established Thanksgiving as a national holiday, but widespread national observance caught on only gradually. Many Southerners saw the new holiday as an attempt to impose Northern customs on them. However, in the late 19th century Thanksgiving’s emphasis on home and family appealed to many people throughout the United States. As a distinctly American holiday, Thanksgiving was also considered an introduction to American values for the millions of immigrants then entering the country. During the 20th century, as the population of the United States became increasingly urban, new Thanksgiving traditions emerged that catered to city dwellers. The day after Thanksgiving gradually became known as the first day of the Christmas shopping season. To attract customers, large retailers such as Macy’s in New York City and Gimbel’s in Philadelphia, Pennsylvania, began to sponsor lavish parades. By 1934 the Macy’s parade, featuring richly decorated floats and gigantic balloons, attracted more than one million spectators annually.