Showing posts from June, 2019

Implementation of Dining Philosopher Problem using Semaphor in C Programming

In this problem, there are five philosophers who can think or eat. There is a circular table with five chairs, each chair belonging
to one philosopher. In the center of the table, there is a bowl of rice, and the table is laid with five single chopsticks.
Initially, all philosophers are thinking. From time to time, a philosopher gets hungry and tries to pick up the two chopsticks that are closest to him (left and right). A philosopher may pick up only one chopstick at a time. Obviously, he cannot pick up a chopstick that is already in the hand of a neighbor and if he finds only one chopstick he has to drop it so that other philosopher can eat. When a hungry philosopher has both his chopsticks (left and right) at the same time, he eats without releasing the chopsticks. When he is finished eating, he puts down both chopsticks and starts thinking again and other philosophers get time to eat.
At once maximum, two philosophers can eat. For example, consider five philosophers are P0, P1, P2, P…

How to Fetch as Google in Search Console New Version

Step 1: Just go to your Search Console and put your URL into the text field on the top with place holding message "Inspect any URL" and hit Enter. Step 2: After step 1, Google will test if the URL is already present or not. If not then click on Test Live URL button. Step 3: After testing the URL will be available to Google. Now you just has to Request indexing as shown in the screenshot. Hope this will work for yours. If you have any problem please comment I will try my best to solve your problem.

Implementation of Banker’s Algorithm in JAVA

The program will read a data file. The name of the data file will be provided as a command line argument. The data file will have the following structure:
First row will represent the maximum units of each resource. There can be any number of resources. 
Second row will contain new request by a process. The first number will be PID i.e process ID of the process making the request and subsequent numbers will be the amount/number of units of each resource the process is requesting. 
Subsequent rows will contain Allocation & Max information about each process. An example file is as follows:
10   5    7 1  1  0  2
0 1 0 7 5 3
2 0 0 3 2 2
3 0 2 9 0 2
2 1 1 2 2 2 
0 0 2 4 3 3
In the above file, the first line tells us that there are 10 units of resource R1, 5 units of R2 and 7 units of R3 in the system. 
The second line tells that process P1 has requested 1 unit of resource R1, 0 units of R2 and 2 units of R3.
The third line tells that process P0 has been allocated 0 units of R1, 1 unit of R2 and 0 …