Submit Search
Upload
Teorical1
•
Download as PPTX, PDF
•
0 likes
•
179 views
E
Ever Blut
Follow
Technology
Business
Report
Share
Report
Share
1 of 5
Download now
Recommended
Unbounded
Unbounded
Ever Blut
Unbounded
Unbounded
Ever Blut
Teorical 1
Teorical 1
everblut
Theorical 1
Theorical 1
everblut
CppCat Checks OpenMW: Not All is Fine in the Morrowind Universe
CppCat Checks OpenMW: Not All is Fine in the Morrowind Universe
Andrey Karpov
ReactJS Component Lifecycle hooks with examples
ReactJS Component Lifecycle hooks with examples
Ravi Mone
Boost statechart library
Boost statechart library
Jan Rüegg
Side effects-con-redux
Side effects-con-redux
Nicolas Quiceno Benavides
Recommended
Unbounded
Unbounded
Ever Blut
Unbounded
Unbounded
Ever Blut
Teorical 1
Teorical 1
everblut
Theorical 1
Theorical 1
everblut
CppCat Checks OpenMW: Not All is Fine in the Morrowind Universe
CppCat Checks OpenMW: Not All is Fine in the Morrowind Universe
Andrey Karpov
ReactJS Component Lifecycle hooks with examples
ReactJS Component Lifecycle hooks with examples
Ravi Mone
Boost statechart library
Boost statechart library
Jan Rüegg
Side effects-con-redux
Side effects-con-redux
Nicolas Quiceno Benavides
Java Programs
Java Programs
Seetharamaiah Vadde
RxJava on Android
RxJava on Android
Dustin Graham
RxJava for Android - GDG DevFest Ukraine 2015
RxJava for Android - GDG DevFest Ukraine 2015
Constantine Mars
Clean code via dependency injection + guice
Clean code via dependency injection + guice
Jordi Gerona
New feature of async fakeAsync test in angular
New feature of async fakeAsync test in angular
Jia Li
The Ring programming language version 1.5.3 book - Part 89 of 184
The Ring programming language version 1.5.3 book - Part 89 of 184
Mahmoud Samir Fayed
Sockets in nach0s
Sockets in nach0s
naniix21_3
Large scale machine learning projects with r suite
Large scale machine learning projects with r suite
Wit Jakuczun
The Ring programming language version 1.8 book - Part 88 of 202
The Ring programming language version 1.8 book - Part 88 of 202
Mahmoud Samir Fayed
Javascript scoping
Javascript scoping
Aditya Gaur
Asyc flow control with javascript generators - redux-saga
Asyc flow control with javascript generators - redux-saga
Pedro Solá
Code generation with javac plugin
Code generation with javac plugin
Oleksandr Radchykov
Generator iterator methods
Generator iterator methods
VikkyNangare1
cpanfileがRubyでパースできることに気づいた俺たちは
cpanfileがRubyでパースできることに気づいた俺たちは
Takafumi ONAKA
AngularJS Testing Strategies
AngularJS Testing Strategies
njpst8
The Ring programming language version 1.9 book - Part 92 of 210
The Ring programming language version 1.9 book - Part 92 of 210
Mahmoud Samir Fayed
Transaction Management Tool
Transaction Management Tool
Peeyush Ranjan
Reactive programming with RxAndroid
Reactive programming with RxAndroid
Savvycom Savvycom
Мониторинг фильмов
Мониторинг фильмов
Wobot
Mark sacro fashion photographer 1 2
Mark sacro fashion photographer 1 2
ramonareps
R&b presentation w video
R&b presentation w video
Stacey_Duncton
Monopoly2
Monopoly2
Slakos
More Related Content
What's hot
Java Programs
Java Programs
Seetharamaiah Vadde
RxJava on Android
RxJava on Android
Dustin Graham
RxJava for Android - GDG DevFest Ukraine 2015
RxJava for Android - GDG DevFest Ukraine 2015
Constantine Mars
Clean code via dependency injection + guice
Clean code via dependency injection + guice
Jordi Gerona
New feature of async fakeAsync test in angular
New feature of async fakeAsync test in angular
Jia Li
The Ring programming language version 1.5.3 book - Part 89 of 184
The Ring programming language version 1.5.3 book - Part 89 of 184
Mahmoud Samir Fayed
Sockets in nach0s
Sockets in nach0s
naniix21_3
Large scale machine learning projects with r suite
Large scale machine learning projects with r suite
Wit Jakuczun
The Ring programming language version 1.8 book - Part 88 of 202
The Ring programming language version 1.8 book - Part 88 of 202
Mahmoud Samir Fayed
Javascript scoping
Javascript scoping
Aditya Gaur
Asyc flow control with javascript generators - redux-saga
Asyc flow control with javascript generators - redux-saga
Pedro Solá
Code generation with javac plugin
Code generation with javac plugin
Oleksandr Radchykov
Generator iterator methods
Generator iterator methods
VikkyNangare1
cpanfileがRubyでパースできることに気づいた俺たちは
cpanfileがRubyでパースできることに気づいた俺たちは
Takafumi ONAKA
AngularJS Testing Strategies
AngularJS Testing Strategies
njpst8
The Ring programming language version 1.9 book - Part 92 of 210
The Ring programming language version 1.9 book - Part 92 of 210
Mahmoud Samir Fayed
Transaction Management Tool
Transaction Management Tool
Peeyush Ranjan
Reactive programming with RxAndroid
Reactive programming with RxAndroid
Savvycom Savvycom
What's hot
(18)
Java Programs
Java Programs
RxJava on Android
RxJava on Android
RxJava for Android - GDG DevFest Ukraine 2015
RxJava for Android - GDG DevFest Ukraine 2015
Clean code via dependency injection + guice
Clean code via dependency injection + guice
New feature of async fakeAsync test in angular
New feature of async fakeAsync test in angular
The Ring programming language version 1.5.3 book - Part 89 of 184
The Ring programming language version 1.5.3 book - Part 89 of 184
Sockets in nach0s
Sockets in nach0s
Large scale machine learning projects with r suite
Large scale machine learning projects with r suite
The Ring programming language version 1.8 book - Part 88 of 202
The Ring programming language version 1.8 book - Part 88 of 202
Javascript scoping
Javascript scoping
Asyc flow control with javascript generators - redux-saga
Asyc flow control with javascript generators - redux-saga
Code generation with javac plugin
Code generation with javac plugin
Generator iterator methods
Generator iterator methods
cpanfileがRubyでパースできることに気づいた俺たちは
cpanfileがRubyでパースできることに気づいた俺たちは
AngularJS Testing Strategies
AngularJS Testing Strategies
The Ring programming language version 1.9 book - Part 92 of 210
The Ring programming language version 1.9 book - Part 92 of 210
Transaction Management Tool
Transaction Management Tool
Reactive programming with RxAndroid
Reactive programming with RxAndroid
Viewers also liked
Мониторинг фильмов
Мониторинг фильмов
Wobot
Mark sacro fashion photographer 1 2
Mark sacro fashion photographer 1 2
ramonareps
R&b presentation w video
R&b presentation w video
Stacey_Duncton
Monopoly2
Monopoly2
Slakos
Блоггер против мусора
Блоггер против мусора
Wobot
CulturalConnections_WEB_WHOLE
CulturalConnections_WEB_WHOLE
Maxine Gurevich
Censo San Pedro Valley - 2015 (Recorte - Belo Horizonte)
Censo San Pedro Valley - 2015 (Recorte - Belo Horizonte)
Rodrigo Cartacho
Фриске vs Плющенко
Фриске vs Плющенко
Wobot
Анализ сообществ проекта "Блогер против мусора" в vk.com
Анализ сообществ проекта "Блогер против мусора" в vk.com
Wobot
Киберпонедельник - тяжелый день для онлайн-ритейлеров! (полная аналитика)
Киберпонедельник - тяжелый день для онлайн-ритейлеров! (полная аналитика)
Wobot
Московские наблюдатели "второй волны": мотивация, медиапредпочтения, онлайн д...
Московские наблюдатели "второй волны": мотивация, медиапредпочтения, онлайн д...
Wobot
Viewers also liked
(11)
Мониторинг фильмов
Мониторинг фильмов
Mark sacro fashion photographer 1 2
Mark sacro fashion photographer 1 2
R&b presentation w video
R&b presentation w video
Monopoly2
Monopoly2
Блоггер против мусора
Блоггер против мусора
CulturalConnections_WEB_WHOLE
CulturalConnections_WEB_WHOLE
Censo San Pedro Valley - 2015 (Recorte - Belo Horizonte)
Censo San Pedro Valley - 2015 (Recorte - Belo Horizonte)
Фриске vs Плющенко
Фриске vs Плющенко
Анализ сообществ проекта "Блогер против мусора" в vk.com
Анализ сообществ проекта "Блогер против мусора" в vk.com
Киберпонедельник - тяжелый день для онлайн-ритейлеров! (полная аналитика)
Киберпонедельник - тяжелый день для онлайн-ритейлеров! (полная аналитика)
Московские наблюдатели "второй волны": мотивация, медиапредпочтения, онлайн д...
Московские наблюдатели "второй волны": мотивация, медиапредпочтения, онлайн д...
Similar to Teorical1
Theorical 1
Theorical 1
everblut
Theoretical presentation1nachos
Theoretical presentation1nachos
colli03
10 Catalyst Tips
10 Catalyst Tips
Jay Shirley
Mockito with a hint of PowerMock
Mockito with a hint of PowerMock
Ying Zhang
Android Loaders : Reloaded
Android Loaders : Reloaded
cbeyls
Javascript quiz. Questions to ask when recruiting developers.
Javascript quiz. Questions to ask when recruiting developers.
Alberto Naranjo
How to Perform Memory Leak Test Using Valgrind
How to Perform Memory Leak Test Using Valgrind
RapidValue
Verilog Lecture4 2014
Verilog Lecture4 2014
Béo Tú
iPhone Seminar Part 2
iPhone Seminar Part 2
NAILBITER
When Good Code Goes Bad: Tools and Techniques for Troubleshooting Plone
When Good Code Goes Bad: Tools and Techniques for Troubleshooting Plone
David Glick
Checking Notepad++: five years later
Checking Notepad++: five years later
PVS-Studio
ZooKeeper Recipes and Solutions
ZooKeeper Recipes and Solutions
Jeff Smith
ZooKeeper Recipes and Solutions
ZooKeeper Recipes and Solutions
Jeff Smith
ZooKeeper Recipes and Solutions
ZooKeeper Recipes and Solutions
Jeff Smith
Dependency Injection on Android
Dependency Injection on Android
Joan Puig Sanz
Checking the Cross-Platform Framework Cocos2d-x
Checking the Cross-Platform Framework Cocos2d-x
Andrey Karpov
A New View of Database Views
A New View of Database Views
Michael Rosenblum
Testing the waters of iOS
Testing the waters of iOS
Kremizas Kostas
Handling Exceptions In C & C++ [Part B] Ver 2
Handling Exceptions In C & C++ [Part B] Ver 2
ppd1961
iOS Unit Testing
iOS Unit Testing
sgleadow
Similar to Teorical1
(20)
Theorical 1
Theorical 1
Theoretical presentation1nachos
Theoretical presentation1nachos
10 Catalyst Tips
10 Catalyst Tips
Mockito with a hint of PowerMock
Mockito with a hint of PowerMock
Android Loaders : Reloaded
Android Loaders : Reloaded
Javascript quiz. Questions to ask when recruiting developers.
Javascript quiz. Questions to ask when recruiting developers.
How to Perform Memory Leak Test Using Valgrind
How to Perform Memory Leak Test Using Valgrind
Verilog Lecture4 2014
Verilog Lecture4 2014
iPhone Seminar Part 2
iPhone Seminar Part 2
When Good Code Goes Bad: Tools and Techniques for Troubleshooting Plone
When Good Code Goes Bad: Tools and Techniques for Troubleshooting Plone
Checking Notepad++: five years later
Checking Notepad++: five years later
ZooKeeper Recipes and Solutions
ZooKeeper Recipes and Solutions
ZooKeeper Recipes and Solutions
ZooKeeper Recipes and Solutions
ZooKeeper Recipes and Solutions
ZooKeeper Recipes and Solutions
Dependency Injection on Android
Dependency Injection on Android
Checking the Cross-Platform Framework Cocos2d-x
Checking the Cross-Platform Framework Cocos2d-x
A New View of Database Views
A New View of Database Views
Testing the waters of iOS
Testing the waters of iOS
Handling Exceptions In C & C++ [Part B] Ver 2
Handling Exceptions In C & C++ [Part B] Ver 2
iOS Unit Testing
iOS Unit Testing
Recently uploaded
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard37
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
MadyBayot
Architecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
apidays
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
apidays
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Edi Saputra
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Deepika Singh
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
apidays
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Jeffrey Haguewood
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
Andrey Devyatkin
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
WSO2
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
AnitaRaj43
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
The Digital Insurer
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
Zilliz
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
johnbeverley2021
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Orbitshub
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
Dropbox
Recently uploaded
(20)
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
Architecting Cloud Native Applications
Architecting Cloud Native Applications
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
Teorical1
1.
2.
3.
In this solution
the producer is free to create items at any time, the consumer doesn't care.
4.
5.
function: producer
6.
start
7.
repeat on true
8.
l->Acquire();
9.
createItem();
10.
in_stock++;
11.
l->Release();
12.
end
13.
function: consumer
14.
start
15.
repeat on true
16.
if in_stock ==
0
17.
Do nothing
18.
else in_stock >
0
19.
l->Acquire();
20.
destroyItem();
21.
in_stock--;
22.
l->Release();
23.
end
24.
Lock: l
25.
integer: in_stock
26.
function: main
27.
start
28.
in_stock = 0
29.
call producer();
30.
call consumer();
31.
32.
class SemaphoreLock
33.
KernelThread: LockHolder =
null;
34.
ThreadQueue: waitQueue;
35.
function: SemaphoreAcquire
36.
start
37.
bool: status =
Interrupt nachos machine.
38.
check if the
current thread have this lock.
39.
thread =
current thread
40.
if lockHolder !=
null
41.
waitQueue = waitfor(thread);
42.
then sleep the
thread.
43.
else
44.
waitQueue.acquire(thread);
45.
lockHolder = current
thread;
46.
restore the nachos
machine with the new status;
47.
end
48.
function: SemaphoreRelease
49.
start
50.
bool: status =
Interrupt nachos machine
51.
if waitQueue is
not empty
52.
lockHolder(current thread) is
ready to run now
53.
end
54.
55.
Lock cl;
56.
Semaphore LinkedList waitQueue;
57.
function: Constructor(Lock *cl)
58.
start
59.
conditionLock = cl;
60.
waitQueue = getSemaphoreLinkedList();
61.
end
62.
function: sleep
63.
start
64.
check if the
current thread has the lock
65.
sleeper = new
Semaphore();
66.
add sleeper to
the WaitQueue
67.
cl->release();
68.
sleeper.P()
69.
cl-> acquire();
70.
end
71.
function: wake
72.
start
73.
check if the
current thread has the lock
74.
if waitQueue is
not empty
75.
Remove the first
thread && use V();
76.
end
77.
function: wakeall
78.
start
79.
check if the
current thread has the lock
80.
repeat until the
WaitQueue are empty
81.
call wake();
82.
end
Download now