<< Chapter < Page Chapter >> Page >

Since we have not fully specified this example's original system, we will leave the details to the reader's imagination.

The lost pathfinder (optional)

In 1997, the Mars Pathfinder seemed to beam its data back to Earth just fine, exceptsometimes it would appear to freeze up. Thefix? Press Control-Alt-Delete from Earth, and re-boot its rover(incurring not only an expensive delay for Mission Control, but the full attention of late-night-TV comedians).

The cause turned out to be a bug in the concurrency protocol, between a low-priority data-gathering mode, which was meantto yield to a high-priority data-sending mode. However, sometimes these priorities would become inverted,with the high-priority thread blocking on the (supposedly) low-priority one. (More detail.) The bug

This is of course not the full Sojourner Rover code, but it is the concurrency-protocol skeleton.The other thousands of lines of code would, of course, be omitted from a Promela prototype.
can be realized in Promela: 1 /* From Spin primer/manual, Gerard Holzman. */ 23 mtype = { free, busy }; /* states for the variable "mutex" */ 4 mtype = { idle, waiting, running } /* states for the processes */5 6 mtype highProc = idle;7 mtype lowProc = idle; 8 mtype mutex = free;9 10 active proctype high_priority()11 { 12 end:13 do 14 :: highProc = waiting;15 atomic { 16 mutex == free ->17 mutex = busy 18 };19 highProc = running; 20 /* work work work; produce data */21 atomic { 22 highProc = idle;23 mutex = free 24 }25 od 26 }27 28 active proctype low_priority() provided (highProc == idle)29 { 30 end:31 do 32 :: lowProc = waiting;33 atomic { 34 mutex == free ->35 mutex = busy 36 };37 lowProc = running; 38 /* work work work; consume data and send it back to Earth. */39 atomic { 40 lowProc = idle;41 mutex = free 42 }43 od 44 }45 4647 /* Note the "provided" clause as part of low_priority()'s declaration. 48 * This condition is monitered and confirmed before every single49 * transition that low_priority() attempts. 50 * (This is a handier syntax than placing that guard condition51 * in front of every single statement within the process.) 52 */

Can you detect the problem using SPIN?

Non-progress: livelock, starvation, and fairness


As described previously , livelock is very similar to deadlock. But in livelock, computation doesn't get completely stuckit simply doesn't do anything sufficiently interesting.

In previous examples, processes waited with a guarded statement. Here, as an example of busy waiting , we repeatedly check for thedesired condition, and otherwise do something. Busy waiting for a condition that never comes true is one commonsituation that leads to livelock. 1 show int x = 1; 23 active[2] proctype busywait()4 { 5 do6 :: x != 0 ->7 printf( "%d waiting.\n", _pid ); 8 :: else ->9 break; 10 od;11 12 printf( "Now this is more interesting.\n" );13 } This example also uses _pid , a read-only variable whose value is the process ID number (0-based) of the given process.

Questions & Answers

important of enocomic
Adu Reply
what is division of labour
Dennis Reply
division of labour can be defined as the separation of task to individuals in any economic system to specialize on it.
what is demand curve
Victoria Reply
demand curve is a downward sloping economic graph that shows the relationship between the price of product and the quantity of the product demanded.
What is demand
Frank Reply
It refers to the quantity of a commodity purchased in the market at a price and at a point of time.
refers to amount of commodities a consumer is willing and able to buy at particular price within a period of time
It is the ability and willingness a customer buys a product or service at a particular price, place and time while other things remaining constant or the same
In which case is opportunity cost is zero
Francis Reply
where no alternative is available
who is the father of economic
Omar Reply
Adam Smith
Adam Smith
Adam smith
Adam Smith
What is monopoly
Mauthoor Reply
it an economic situation where one individual controls the essential commodities or value product for maximum profit
monopoly is a market situation in which there is only one producer of a good or service which has no close substitutes
is where only one person is solely the price taker
what is Monopoly
Dauda Reply
The word Monopoly is a Latin word. it is the combination of two words-Mono means single and Poly means seller. thus Monopoly means single seller. but this is not the full meaning of Monopoly. Monopoly must produce a product which does not have close substitute in the market.
Monopoly is define as a firm in an industry with very high barriers to entry.
If close substitute is available, Monopoly will be a king without a crown.
what does it array
Cbdishakur Reply
what are the differences between monopoly and.oligopoly
Onome Reply
what are the difference between monopoly and oligopoly
The deference between Monopoly and Oligopoly: Monopoly means:A single-firm-Industry producing and selling a product having no close business and Oligopoly means:A market structure where a few sellers compete with each other and each controls a significant portion of market .
so that the price-output policy one affects the other.
what are difference between physical policy and monotory policy
what is economic
Emakpor Reply
what is economic
the word economic was derived from the Greek word oikos (a house)and mein(to manage) which in effect meant managing a household with the limited funds available 🙂.
good excample about scarsity
An Enquiry into the nature and causes of wealth Nations, this book clearly defined what economic is🙂🙂🙏🙏 thank you...
good example about scarcity: money,time, energy, human or natural resources. Scarcity of resources implies that there supply is very much limited in relation to demand.
equilibrium is a situation in which economic forces such as demand and supply are balanced and in the absence of external influences,the value of economic variables will not change
Onome Reply
marginal cost and marginal revenue is equilibrium .
what is equilibrium
Rodrice Reply
policy prescriptions for unemployment
Jeslyne Reply
Am working on it
what are the factors effecting demand sedule
Kalimu Reply
we should talk about more important topics, you can search it on Google n u will find your answer we should try to focus on how we can improve our society using economics
so good night
Why do people buy more grapes in December than in July?
because at time know money
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get the best Algebra and trigonometry course in your pocket!

Source:  OpenStax, Model checking concurrent programs. OpenStax CNX. Oct 27, 2005 Download for free at http://cnx.org/content/col10294/1.3
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Model checking concurrent programs' conversation and receive update notifications?