while(TRUE){
while (turn != 0) /* Should here be a semicolon ( ; ) to make while a
NULL repetition? */
critical_region();
turn = 1;
noncritical_region();
}
/* (a) PROCESS 0 */
while(TRUE){
while (turn != 1) /* Should here be a semicolon ( ; ) to make while a
NULL repetition? */
critical_region();
turn = 0 ;
noncritical_region();
}
/* (b) PROCESS 1*/
Aside:
Initially, process 0 inspects turn, find it to be 0, and enter the
critical region.Process 1 also finds it to be 0 and therefore sits in a
tight loop continually test to see when it becomes 1.
End Aside.
My problem: if there is no semicolon following the inner while , then
(a) process 0 , In the code, when the variable turn set to 0 initially,
while( turn != 0) is false, so the following line critical_region is
skipped over !!
then it will entry noncritical_region.
The same ,(b)Process 1
as turn set to 0 inititally, while (turn != 1) is true.
it should enter the while loop,execute critical_region?
It Contradicts with the book!!!
Please look at it and help me,Thank you. 2 1305
On 13 Dec 2006 07:37:37 -0800, "Solo.Wolve" <wa*******@gmail.com>
wrote:
[...]
Actually, if you read *carefully* the book, there is a semicolon, its
written like that :
while (turn != 0) /* loop */ ;
^ here it is, after the comment.
--
al. - epsylon at gmail dot com
epsylon wrote:
On 13 Dec 2006 07:37:37 -0800, "Solo.Wolve" <wa*******@gmail.com>
wrote:
[...]
Actually, if you read *carefully* the book, there is a semicolon, its
written like that :
while (turn != 0) /* loop */ ;
^ here it is, after the comment.
--
al. - epsylon at gmail dot com
I saw it actually.
I mean, the loop is just an empty loop, Or it contains the following
stetement,
critical_region?
If it's not empty loop, I don't understand. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: David Brown |
last post by:
Hello. I recently came across a free operating system called Unununium (or
something like that) and it was developed in Python and Assembly.
Now, I have been looking for a way to make an...
|
by: Kevin A |
last post by:
Hi,
Is there a way to determine the name and version of the
operating system in a portable way? (for Solaris/Linux)
Thanks,
Kevin
|
by: Vavel |
last post by:
Hi all!
I want to insert the record into the table by
using an application program that includes the following statements:
EXEC SQL BEGIN DECLARE SECTION;
long hvInt_Stor;
long hvExt_Stor;...
|
by: seash |
last post by:
H
iam developing my windows form application(ide:visual studio.net 2003, visual c#) on windows 2000 professional operating system , but when i run the exe on Xp operating system, the screen ...
|
by: Saadi |
last post by:
Hey Guys,
I am looking to develop a simple infact a very simple Operating System, to
submit as my BS final project, which can independently start the computer and
some simple application which...
|
by: arnuld |
last post by:
hai all,
i am standing on a "crossroad to C++". I am here in front of you as i
have a problem. i will be brief. Please do not think: "arnuld is sick",
i am really struggling & doing hard-work to...
|
by: Solo.Wolve |
last post by:
while(TRUE){
while (turn != 0) /* Should here be a semicolon ( ; ) to make while a
NULL repetition? */
critical_region();
turn = 1;
noncritical_region();
}
/* (a) PROCESS 0 */
|
by: newstips6706 |
last post by:
The Operating System of Organic Machines
Building your own "KERNEL".
--------------------------------------------------------------------------------
|
by: jdresow |
last post by:
I installed MySQL on a windows server 2003, in an acxtive directory domain and I get error 32 which is a sharing error. I do not understand this and I am also adding the first several lines of my...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| | |