问题 多项选择题

[说明]


某大中型电器商场仓库对货物的存取由多台配送车自动化完成,该仓库有多个入口和出口。当空配送车进入该仓库时,从仓库入口处由配送控制系统查询相应电器放置的货架位置(假设每台电器占用唯一的货架位置);当配送车装载货物从出口驶出时,系统将相应的货架位置标记设置为空。
假设实现电器商场仓库系统管理的伪指令如表8-5所示。


根据上述描述,在商场仓库入口处的伪代码程序如下。
x = Get ();
IF x =NULL THEN return 0;
Writ (x,1);
1. 若两辆配送车在不同的入口处同时执行上述代码,则可能会出现什么问题请用100字以内的文字简要说明。

答案

参考答案:(A)满足BPL协议的伪代码
SLock(T);
x = Get();
IF x = NULL THEN return 0;
Upgrade(T);
Writ(x,A);
Unlock(T);
(B) 会产生死锁
一个产生死锁的调度示例如表H-F所示(注:调度次序不局限于本参考答案:,但执行语句不能写在一行,必须是并发而不能是串行,且在Upgrade后等待)

解析:
这是一道要求读者掌握2PL协议实际应用的综合理解题,本试题的解答思路如下。
(1) 2PL协议规定:读数据前加S锁,事务结束时释放;写数据前加X锁,事务结束时释放;当要修改数据时,事务应对自己的加的S锁升级为X锁。
为保证入口处伪代码正确地并发执行,引入共享锁指令SLock(T)和独占锁指令XLock(T)对表T进行加锁;Upgrade(T)用于对表T所加的共享锁升级为独占锁;解锁指令Unlock(T)用于对表T进行解锁。满足2PL协议入口处的伪代码程序如下。
SLock(T);
x = Get ();
IF x = NULL THEN return 0;
Upgrade (T);
Writ (x,1);
Unlock (T);
(2) 2PL协议解决的是事务并发时的正确调度,并不能解决死锁问题。通常,死锁问题是由数据库管理系统(DBMS)进行检测和解除的。因此,满足2PL协议的入口处的伪代码程序,在并发执行时还有可能会产生死锁。例如,一个产生死锁的调度示例如表8-6所示。
[*]

选择题
单项选择题

The sudden, dramatic explosion in value of online social media sites like Facebook and Twitter is reminiscent of the rise, about 15 years ago, of the online businesses that created the "dotcom bubble. " The Internet was far less widely used than it is today. Still, visionaries saw the potential for the Internet we have today, so virtual companies sprung up and grew like weeds as investors threw money their way. Some, like Google and Amazon, developed an enduring online presence and lasting financial value. But far too many quickly lost value when it became apparent that their rapid growth wasn’t yielding revenue.

So, how much is Facebook’s network of users really worth The potential is clear—when so many people are gathered in one virtual place, offering so much personal information about themselves, they create an unprecedented platform for targeted advertising. Or they would, if they were on the network to shop. When eBay and Amazon suggest products to their customers, they’re talking to people who’ve already proven that they’re interested in buying similar products. People go on Facebook for a variety of reasons-to catch up with old friends, share pictures, make new acquaintances, and talk, sometimes endlessly, about themselves. Whether they’ll appreciate having their virtual conversations interrupted by advertising, targeted or not, remains unclear.

It’s also unclear whether Facebook will actually be able to share information about its users’ browsing habits with advertisers. Complaints about the ineffectiveness of Facebook’s privacy policies have arisen in multiple countries, part of a larger social concern about how private information gets used on line. In December, the Federal Trade Commission issued a proposed framework that, among other things, would permit Facebook users to block advertisers from accessing information about their online interests. If that framework is implemented and widely used by Facebook subscribers, it could seriously impair the site’s value as a potential platform for targeted marketing.

What is clear is that Goldman Sachs has a significant interest in Facebook’s financial value, at least for the short term. Goldman Sachs’ decision to invest heavily in Facebook has had some interesting impacts. For one thing, the investment has allowed Facebook an opportunity to postpone issuing an IPO. That means that, at least for the moment, Facebook doesn’t yet have to disclose its finances or publicly address investor complaints.

Goldman Sachs’ investment also puts the firm in an ideal position to handle Facebook’s IPO when it eventually is issued, perhaps sometime next year. That, of course, has the potential to generate substantial revenues for Goldman Sachs’ clients. Google’s 2004 IPO raised an initial $1.2 billion for the company. After all the propaganda, Facebook’s IPO can hardly be expected to raise less. However, there remains a significant question as to whether Facebook’s potential for generating income is more virtual than real. If it turns out that Facebook can’t live up to its potential for generating advertising revenue, venture capitalists who invest for the long term may get burned.

The text is written to answer the question()

A. Will the social media be the next dotcom bubble

B. Does Goldman Sachs really want to invest in Facebook

C. When will it be the right time for Facebook to issue its IPO

D. What lessons can we learn from the ups and downs of social media