Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

help with semaphores and monitors

Status
Not open for further replies.

icepil@hotmail.com

Newbie level 1
Newbie level 1
Joined
Jan 13, 2004
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
29
i need help answering some questions. if you know one of them, i'd like to have something posted from you. number 3 is giving me the hardest time, and i need help with that the most, see ya friends.

1)
A data structure can be shared between reader processes and a single writer process. Reader processes can only read from the data structure and the writer process can only write to it. Write, using semaphores, the body (in pseudocode) of an algorithm showing how semaphores can be used to allow many concurrent reader processes and a single writer process but not both.

2)
A critical conditional region (CCR) is of the form:
Region X when B do S1;
Sketch (in pseudocode) the structure of an algorithm showing how to implement a CCR using semaphores.

3)
One of the criticisms of monitors is that condition synchronization is too low-level and unstructured. Explain what is meant by this statement. A higher level monitor synchronisation primitive might be like the form:
WaitUntil Boolean_expression;
where the process is delayed until the Boolean expression evaluates to true. For example:
WaitUntil x < y + 5;
Although this form of condition synchronization is more structured it is not found in most languages which support monitors. Explain why this. Show how the bounded buffer problem can be solved using the WaitUntil synchronization primitive inside a monitor.

/Warning #1 - Do not make crossposts.
Your second message was deleted.
(klug)/
 

Dear icepil_hotmail.com

Your questions are very interesting but is verry dificult to answer them in a general maner.

Why??

Because you ask to write an general code ("pseudocode") for topics like "monitors" "semaphores" or "critical sections" wich are too closely related with the programming language used to get an general answer (in my opinion).

So, my advice is : focus on a paricular programming language (example VB.NET), then study verry carefful the concrete implementation of those topics (you will found them in advanced Threading sections)

For example if you are using .NET platform and VB.NET language i highly recomend you the book

".Net Multythreading"
by Alan L. Dennis

wich treat all your questions in 500 pages!!!


Good lock!!
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top