<< 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

Is there any normative that regulates the use of silver nanoparticles?
Damian Reply
what king of growth are you checking .?
What fields keep nano created devices from performing or assimulating ? Magnetic fields ? Are do they assimilate ?
Stoney Reply
why we need to study biomolecules, molecular biology in nanotechnology?
Adin Reply
yes I'm doing my masters in nanotechnology, we are being studying all these domains as well..
what school?
biomolecules are e building blocks of every organics and inorganic materials.
anyone know any internet site where one can find nanotechnology papers?
Damian Reply
sciencedirect big data base
Introduction about quantum dots in nanotechnology
Praveena Reply
what does nano mean?
Anassong Reply
nano basically means 10^(-9). nanometer is a unit to measure length.
do you think it's worthwhile in the long term to study the effects and possibilities of nanotechnology on viral treatment?
Damian Reply
absolutely yes
how to know photocatalytic properties of tio2 nanoparticles...what to do now
Akash Reply
it is a goid question and i want to know the answer as well
characteristics of micro business
for teaching engĺish at school how nano technology help us
Do somebody tell me a best nano engineering book for beginners?
s. Reply
there is no specific books for beginners but there is book called principle of nanotechnology
what is fullerene does it is used to make bukky balls
Devang Reply
are you nano engineer ?
fullerene is a bucky ball aka Carbon 60 molecule. It was name by the architect Fuller. He design the geodesic dome. it resembles a soccer ball.
what is the actual application of fullerenes nowadays?
That is a great question Damian. best way to answer that question is to Google it. there are hundreds of applications for buck minister fullerenes, from medical to aerospace. you can also find plenty of research papers that will give you great detail on the potential applications of fullerenes.
what is the Synthesis, properties,and applications of carbon nano chemistry
Abhijith Reply
Mostly, they use nano carbon for electronics and for materials to be strengthened.
is Bucky paper clear?
carbon nanotubes has various application in fuel cells membrane, current research on cancer drug,and in electronics MEMS and NEMS etc
so some one know about replacing silicon atom with phosphorous in semiconductors device?
s. Reply
Yeah, it is a pain to say the least. You basically have to heat the substarte up to around 1000 degrees celcius then pass phosphene gas over top of it, which is explosive and toxic by the way, under very low pressure.
Do you know which machine is used to that process?
how to fabricate graphene ink ?
for screen printed electrodes ?
What is lattice structure?
s. Reply
of graphene you mean?
or in general
in general
Graphene has a hexagonal structure
On having this app for quite a bit time, Haven't realised there's a chat room in it.
what is biological synthesis of nanoparticles
Sanket Reply
how did you get the value of 2000N.What calculations are needed to arrive at it
Smarajit Reply
Privacy Information Security Software Version 1.1a
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?