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 1306
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: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| | |