<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5313576602653501716</id><updated>2024-10-25T09:57:56.808+05:30</updated><category term="Operating-System"/><category term="Computer-Graphics"/><category term="Software-Engineering"/><category term="BCA-Sem-3rd"/><category term="BCA-Sem-1st"/><category term="BCA-Sem-2nd"/><category term="BCA-Sem-4th"/><category term="Hindi-Stories"/><category term="Amazing-Facts"/><category term="BCA-Sem-5th"/><category term="BCA-Sem-6th"/><category term="Computer Network"/><title type='text'>All BCA (Best Courses Academy)</title><subtitle type='html'>You can make anything learn with easy and fun on ALLBCA&#xa;with this wonderful quote, we are launch to our website allbca.com for all passionate learners or students.&#xa;ALLBCA is an advanced and adaptive online learning platform where focus to provide you latest study material of all important topics.&#xa;So you can learn and prepare from anywhere, anytime and boost your skill beyonds the limits.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://www.allbca.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='https://www.allbca.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Mayank Rana</name><uri>http://www.blogger.com/profile/06163424302596650438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs9mOMQbRjoNrVnY7AbBycXEpeOG7szPXA2y_RbbeTVJ25GEGpq6q-gZxcoKqROoy4G51CI9ZCvXhjBXCUH8gb-MvrIfJnbBBdt4BY6sgH3zI2blMucgSoV-XQYw6d9g/s125/mayankrana.webp'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>66</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5313576602653501716.post-704867865515582738</id><published>2021-08-20T22:12:00.001+05:30</published><updated>2021-08-20T22:12:38.085+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Network"/><title type='text'>Congestion Control Algorithm &amp; its causes | Diff. Flow Contol</title><content type='html'>
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;img alt=&quot;Congestion-Control-Algorithm-and-Different-Flow-Contol-allbca&quot; data-original-height=&quot;300&quot; data-original-width=&quot;400&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIFzEYeWhqrvf5PLq-bIxD9wTsQv-akJXUDjKc-yJKTYwgvyxxprUk6Am4sS_vG71ftNpxv0sts314AnR45foYM4szRuGIl5DsiAsm1DH39xIW81lG6xzkrHB8dq2i9q2Gf06cEffFTA/s1600/Congestion-Control-in-computer-network-by-studywow.jpg&quot;  width=&quot;320&quot; title=&quot;Congestion-Control-Algorithm-and-Different-Flow-Contol-allbca&quot; /&gt;&lt;/div&gt;

&lt;strong&gt;allbca: &lt;em&gt;Topics=&lt;/em&gt;&lt;/strong&gt; 1.Congestion. 2.Congestion Control and its causes. 3.Difference between Congestion Control and Flow Control. 4.Congestion Control Algorithm. 5.How to measure performance of network.&lt;br /&gt;
Read more topics of Computer Network.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Q1. What is congestion in the computer network ?&lt;/h3&gt;
&lt;strong&gt;Ans.&lt;/strong&gt; &lt;span style=&quot;color: #ff0066;&quot;&gt;Congestion is the situation in which too many packets present in the network causes packet delay and loss that degrades performance of the network.&lt;/span&gt; The network transport layer handles the responsibility of congestion. The network layer have to determine what to do with the excess packets, because it directly experiences it.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Q2. What is congestion control? What are the causes of congestion?&lt;/h3&gt;
&lt;strong&gt;Ans.&lt;/strong&gt; Congestion is an important issue that can arise in packet switched network. Congestion is a situation in communication networks in which too many packets are present in a part of the subnet, performance degrades.&lt;br /&gt;
Congestion in a network may occur when the load on the network (i.e. the number of packets sent to the network) is greater than the capacity of the network (i.e. the number of packets a network can handle).&lt;br /&gt;
&lt;br /&gt;
In other words, when too much traffic is offered, congestion sets-in and performance degrades sharply.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;img alt=&quot;Concept-Congestion-Control-by-allbca.com&quot; data-original-height=&quot;960&quot; data-original-width=&quot;1280&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-WLwTZT4hiy5N1J4UgNYIg79pjBxzm6SPNeNIJsZTsNps-4gxP9VE3_xegBmA1O62qBOqf27iNrCagHTiIueMuXToLGaE5ZonyxVlPuc_GXtktesjkkJ4IWlwBnBl-z9XHBbiyppB2w/s1600/Concept-Congestion-Control-by-studywow.com.jpeg&quot; title=&quot;Concept-Congestion-Control-by-allbca.com&quot; width=&quot;400&quot; /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;h4&gt;
Causing of Congestion :&lt;/h4&gt;
The various causes of congestion in a subnet are as follows:&lt;br /&gt;
&lt;strong&gt;1.&lt;/strong&gt; The input traffic rate exceeds the capacity of the output lines. If suddenly, a stream of packet start arriving on three or four input lines and all need the same output line. In this case a queue will be built up.&lt;br /&gt;
If there is insufficient memory to hold all the packets, the packet will be lost. Increasing the memory to unlimited size does not solve the problem. This is because, by the time packets reach front of the queue, they have already timed out (as they waited the queue).&lt;br /&gt;
When timer goes off source transmits duplicate packet that are also added to the queue. Thus, same packets are added again and again, increasing the load all the way to the destination.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;img alt=&quot;Congestion-diagram-by-allbca.com&quot; data-original-height=&quot;481&quot; data-original-width=&quot;1280&quot; height=&quot;150&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgurKR6fVDGLiZq9aHQdE-SJqfgRai7MQZTmaYoZGfr1OE-RsCh3-hnkXOZc6BkLzdQmnA-UhK2sUGg6o-3tyFVVYg5hMFSdEoVrhKi5GcQbpZLCmlve4Pz1_CFjKrWo8LNX2N7-VfkoQ/s1600/Congestion-diagram-by-studywow.com.jpeg&quot; title=&quot;Congestion-diagram-by-allbca.com&quot; width=&quot;400&quot; /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;strong&gt;2.&lt;/strong&gt; The routers are too slow to perform bookkeeping tasks (queuing buffers, updating tables etc).&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;3.&lt;/strong&gt; The routers&#39; buffer is too limited.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;4.&lt;/strong&gt; Congestion in a subnet can occur if the processors are slow. Slow speed CPU at routers will perform the routine tasks (such as queuing buffers, updating table etc.) slowly. As a result of this, queues are built-up even though there is excess line capacity.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;5.&lt;/strong&gt; Congestion is also caused by slow links. This problem will be solved when high speed links are used.&lt;br /&gt;
But it is not always the case. Sometimes increase in link bandwidth can further deteriorate the congestion problem as higher speed links may make the network more unbalanced.&lt;br /&gt;
Congestion can make itself worse. If a router&quot; does not have free buffers, it start ignoring/discarding the newly arriving packets.&lt;br /&gt;
When these packets are discarded. the sender may retransmit them after the timer goes off. Such packets are transmitted by the sender again and again until the source gets the acknowledgement of these packets.&lt;br /&gt;
Therefore multiple transmission of packets will force the congestion to take place at the sending end.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Q3. What are the differences between flow control and congestion control?&lt;/h3&gt;
&lt;strong&gt;Ans.&lt;/strong&gt; &lt;strong&gt;Differences between Flow Control and Congestion Control&lt;/strong&gt;&lt;br /&gt;
&lt;table style=&quot;height: 550px; width: 350px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;th&gt;Basis&lt;/th&gt;&lt;th&gt;Flow Control&lt;/th&gt;&lt;th&gt;Congestion Control&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Operator&lt;/td&gt;&lt;td&gt;Done by server machine or sender machine.&lt;/td&gt;&lt;td&gt;Done by router.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Buffering&lt;/td&gt;&lt;td&gt;Process buffering.&lt;/td&gt;&lt;td&gt;Does not process.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Bandwidth&lt;/td&gt;&lt;td&gt;It cannot block the bandwidth medium.&lt;/td&gt;&lt;td&gt;It block the bandwidth medium.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Packet lost&lt;/td&gt;&lt;td&gt;Packet is lost between sender and server.&lt;/td&gt;&lt;td&gt;Other users packet is lost.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Performance&lt;/td&gt;&lt;td&gt;Affect less on network performance.&lt;/td&gt;&lt;td&gt;Affects the network performance.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;h3&gt;
Q4. Describe the congestion control algorithm commonly used?&lt;/h3&gt;
&lt;strong&gt;Ans.&lt;/strong&gt; There are two types of congestion control algorithm :&lt;br /&gt;
&lt;h3&gt;
1. Leaky Bucket Algorithm :&lt;/h3&gt;
The leaky bucket implementation is used to control the rate at which traffic is sent to the network. Leaky bucket implementation is same as bucket having a hole at the bottom such as,&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;•&lt;/strong&gt; Imagine a bucket with a small hole in the bottom, as illustrated in Fig. (a). No matter the rate at&lt;br /&gt;
which water enters the bucket, the outflow is at a constant rate,r, when there is any water in the bucket and zero when the bucket is empty.&lt;br /&gt;
Also, once the bucket is full, any additional water entering it spills over the sides and is lost (i.e. does not appear in the output under the hole).&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;img alt=&quot;Leaky-bucket-Congestion-Control-Algorithm-simple-diagram-by-allbca.com&quot; data-original-height=&quot;1010&quot; data-original-width=&quot;1280&quot; height=&quot;315&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifiDNxVj5NF-WF0hSqMxmLwcqnZCZ5RZ5-lMBqBidf2vARO9CoNdA1n3vO0gnQENGpkSaoC-0_9vYSATCdLK0HrA2CmXQT5HM730szuQAMNhyphenhyphent73pIiHe7f4BFPrqMpmzehjxXc4chLw/s1600/Leaky-bucket-Congestion-Control-Algorithm-simple-diagram-by-studywow.com.jpeg&quot; title=&quot;Leaky-bucket-Congestion-Control-Algorithm-simple-diagram-by-allbca.com&quot; width=&quot;400&quot; /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;strong&gt;• &lt;/strong&gt;The same idea can be applied to packets, as shown in Fig (b). Conceptually, each host is connected to the network by an interface containing a leaky bucket, that is, a finite internal queue. If a packet arrives at the queue when it is full, the packet is discarded.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;img alt=&quot;Leaky-bucket-Congestion-Control-Algorithm-simple-by-allbca.com&quot; data-original-height=&quot;959&quot; data-original-width=&quot;1280&quot; height=&quot;298&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIqE7UOSoMgWKG_vqbr4YU0FKb5gyEBQCywmvjkcDpGLcb2LHIzc3uiEYI_L86Omp_DsZInQlRXGLowa2pTjDJ1j1tjCaaH3CiALjYCWHdcel6FXZFKYBNZQHjK-OEJsYlqk-cNXA2sQ/s1600/Leaky-bucket-Congestion-Control-Algorithm-simple-by-studywow.com.jpeg&quot; title=&quot;Leaky-bucket-Congestion-Control-Algorithm-simple-by-allbca.com&quot; width=&quot;400&quot; /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;strong&gt;• &lt;/strong&gt;In other words, if one or more processes within the host try to send a packet when the maximum number is already queued, the new packet is unceremoniously discarded.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;• &lt;/strong&gt;The host is allowed to put one packet per clock tick onto the network. Again, this can be enforced by the interface card. This mechanism turns an uneven flow of packets from the user processes inside the host into an even flow of packets onto the network, smoothing out bursts and greatly reducing the chances of congestion.&lt;br /&gt;
&lt;br /&gt;
The following steps are performed:&lt;br /&gt;
&lt;strong&gt;Step 1.&lt;/strong&gt; When the host has to send a packet, the packet is thrown into the bucket.&lt;br /&gt;
&lt;strong&gt;Step 2.&lt;/strong&gt; The bucket leaks at a constant rate, meaning the network interface transmits packets at a constant rate.&lt;br /&gt;
&lt;strong&gt;Step 3.&lt;/strong&gt; Bursty traffic is converted to a uniform traffic by the leaky bucket.&lt;br /&gt;
&lt;strong&gt;Step 4.&lt;/strong&gt; In practice the bucket is a finite queue that outputs at a finite rate.&lt;br /&gt;
&lt;strong&gt;Step 5.&lt;/strong&gt; If the traffic consists of variable length packets, the fixed output rate must be based on the number of bytes or bits. The following is an algorithm for variable-length packets:&lt;br /&gt;
&lt;strong&gt;(i)&lt;/strong&gt; Initialise a counter to n at the tick of the clock.&lt;br /&gt;
&lt;strong&gt;(ii)&lt;/strong&gt; It n is greater than the size of the packet, send the packet and decrement the counter by the packet size. Repeat this step until n is smaller than the packet size.&lt;br /&gt;
&lt;strong&gt;(iii)&lt;/strong&gt; Reset the counter and go to step 1.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
2. Token Bucket Algorithm:&lt;/h3&gt;
As we know that, leaky bucket algorithm enforces a rigid pattern at the output stream, irrespective of the pattern of the input. For many applications, it is better to allow the output to speed up somewhat when a larger bursts arrives than to loose the data.&lt;br /&gt;
&lt;br /&gt;
The token bucket algorithm allows idle hosts to accumulate credit for the future in the form of tokens. For each tick of the clock, the system sends n tokens to the bucket. The system removes one token for every cell (or byte) of data sent. The token bucket can easily be implemented with a counter. The token is initialised to zero.&lt;br /&gt;
&lt;br /&gt;
Each time a token is added, the counter is incremented by 1. Each time a unit of data is sent, the counter is decremented by 1. When the counter is zero the host cannot send data.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;This algorithm follows the following steps: &lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;Step 1.&lt;/strong&gt; In regular intervals tokens are thrown into the bucket.&lt;br /&gt;
&lt;strong&gt;Step 2.&lt;/strong&gt; The bucket has a maximum capacity.&lt;br /&gt;
&lt;strong&gt;Step 3.&lt;/strong&gt; If there is a ready packet, a token is removed from the bucket and the packet can be send.&lt;br /&gt;
&lt;strong&gt;Step 4.&lt;/strong&gt; If there is no token in the bucket, the packet cannot be send.&lt;br /&gt;
In Fig. (a), token bucket holding two tokens, before packets are send out.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;img alt=&quot;Token-bucket-Congestion-Control-Algorithm-diagram-1-by-allbca.com&quot; data-original-height=&quot;960&quot; data-original-width=&quot;1280&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs56vpeg0guP8CpCVA8XKdmwXoVd4tqcAL7-BdLxf33m39YZuLxfsSu1uUa4pp8nrRd1TXv05f20M_Z3B5jV97KPXhjCGcfNsXzcLYjVcgFs73Cnw1zJM1Be5WA13rAEs_b8YBndVOfg/s1600/Token-bucket-Congestion-Control-Algorithm-diagram-1-by-studywow.com.jpeg&quot; title=&quot;Token-bucket-Congestion-Control-Algorithm-diagram-1-by-allbca.com&quot; width=&quot;400&quot; /&gt;&lt;/div&gt;
&lt;br /&gt;
When token bucket after two packets are send. One packet still remains as no token is left. As shown in Fig(b).&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;img alt=&quot;Token-bucket-Congestion-Control-Algorithm-diagram-2-by-allbca.com&quot; data-original-height=&quot;960&quot; data-original-width=&quot;1280&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiapcEolr3Ggb-vwc_KQTX0V48SweoQMUv7Ebz2Y6z4Ais9zdVghwJH8Ug7aq-aNyHEDvjpXRMK5OTC8XUChJK_5w2uYF25z-yqc3LBsTaPwaiTG3uvTyBram51e2DhKynfS0k_Wh1jrQ/s1600/Token-bucket-Congestion-Control-Algorithm-diagram-2-by-studywow.com.jpeg&quot; title=&quot;Token-bucket-Congestion-Control-Algorithm-diagram-2-by-allbca.com&quot; width=&quot;400&quot; /&gt;&lt;/div&gt;
&lt;br /&gt;
Now, if the host wants to send bursty data, it can consume all 10,000 tokens at once for sending 10,000 cells or bytes. Thus, a host can send bursty data as long as bucket is not empty. As shown in Fig(c).&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;img alt=&quot;Token-bucket-Congestion-Control-Algorithm-diagram-by-allbca.com&quot; data-original-height=&quot;720&quot; data-original-width=&quot;1280&quot; height=&quot;225&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiybVDjDgKnHWrAuvkU8az1l1UQepPo357X7Ppp4fuZh3wtupUDHMOB5Lm5ctsnq9aiKH7rpbT6BgVLKjg31L1_9cOsodKxAHbQI9T-GdGRKr0iXKBtjVSduSz-D8-4zCUnTOd39M5NQ/s1600/Token-bucket-Congestion-Control-Algorithm-diagram-by-studywow.com.jpeg&quot; title=&quot;Token-bucket-Congestion-Control-Algorithm-diagram-by-allbca.com&quot; width=&quot;400&quot; /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Q5. Explain the concept of congestion control and also measure the performance on the network?&lt;/h3&gt;
&lt;strong&gt;Ans.&lt;/strong&gt; Congestion is the situation, will be occurs, when too many packets are present in the subnet (as a part of a larget network). Congestion degrades the performance of the network. When the number of packets dumped into the subnet by the hosts is within its carrying capacity, they all are delivered and the number delivered is proportional to the number sent, except for a few that are afflicted with transmission occurs. However, as the traffic increases too far, the routers are no longer able to handle and they begin losing the packets. At very high traffic, performance collapses completely and almost no packets are delivered so far.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;img alt=&quot;Congestion-occur-when-too-much-traffic-by-allbca.com&quot; data-original-height=&quot;849&quot; data-original-width=&quot;1133&quot; height=&quot;298&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihcXzaaaOYGpzjtfvPaYEZSBXdQ2-raWlu4Y4usJcEk7OsTJo6HXHy6VEjolSW6Yfh2mEtPKw2Zy27I98SCL_efOUrO7GIQl1-3lNSsRV3avlbUPJK2vYgZRvC26HLbpZT4wyCxQez1g/s1600/Congestion-occur-when-too-much-traffic-by-studywow.com.jpeg&quot; title=&quot;Congestion-occur-when-too-much-traffic-by-allbca.com&quot; width=&quot;400&quot; /&gt;&lt;/div&gt;
&lt;br /&gt;
congestion control algorithm refers to techniques and mechanisms that can either present the congestion, before it happens in the network, or remove the congestion, after it has happened.&lt;br /&gt;
Congestion control involves two factors that measure the performance of the network.&lt;br /&gt;
&lt;h4&gt;
1. Delay :&lt;/h4&gt;
It can be measure, when the load is much less than the capacity of the network, the delay will be minimum and composed of propagation delay and processing delay. Note that the delay becomes infinite when the load is greater than the capacity.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
2. Throughput :&lt;/h4&gt;
It can define in a network as the number of packets passing through the network in a unit of time. When the load is below the capacity of the network, the throughput increases. Note that, when the load is below the capacity of the network, the throughput increases proportionally with the node.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;img alt=&quot;Congestion-Delay-as-function-of-load-by-allbca.com&quot; data-original-height=&quot;859&quot; data-original-width=&quot;1143&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZBOWLcTAbOgqAsXDkhTTQT5UPNFPI3UiD0RGc2xK-obk4pPCLvI5bvhg1cqpRVp85ttSWa72WI3eNFawSyly2GQYlUeO6h_DWJmYPtfX7rbo-tep2PzcpZ9oPXEstSB0rLP3kqTWreQ/s1600/Congestion-Delay-as-function-of-load-by-studywow.com.jpeg&quot; title=&quot;Congestion-Delay-as-function-of-load-by-allbca.com&quot; width=&quot;400&quot; /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;img alt=&quot;Congestion-through-as-a-function-of-load-by-allbca.com&quot; data-original-height=&quot;959&quot; data-original-width=&quot;1280&quot; height=&quot;298&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3GBkGdAcaAN-9rD4aExWPoS17LHyGSGVrOuruLZIPc1XPoeVk6TlwwM1kVeryatGUd3WIghlyezlWORaUnaPBF4vPdO5fs0itmQ3p-VWUeIZYCs2ssTrWl8bfIwPFqBsctfFLTskkCg/s1600/Congestion-through-as-a-function-of-load-by-studywow.com.jpeg&quot; title=&quot;Congestion-through-as-a-function-of-load-by-allbca.com&quot; width=&quot;400&quot; /&gt;&lt;/div&gt;
&lt;br /&gt;
We expect the throughput to remain constant, even after the load reaches the capacity. The reason for that is the discarding of packets by the routers. Whenever the load exceeds the capacity, the queues become full and then the routers have to discard some packets. The performance of the network is shown in given Fig. (b) and (c), on the basic of delay and throughput.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[Topics= 1.Congestion. 2.Congestion Control and its causes. 3.Difference between Congestion Control and Flow Control. 4.Congestion Control Algorithm. 5.How to measure performance of network.]&lt;br /&gt;
&lt;br /&gt;
[Topics= 1.Congestion. 2.Congestion Control and its causes. 3.Difference between Congestion Control and Flow Control. 4.Congestion Control Algorithm. 5.How to measure performance of network.]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Join us on Facebook and Twitter&amp;nbsp; to get the latest study material. You can also ask us any questions.&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;Facebook =&amp;nbsp;&lt;a href=&quot;https://www.fb.com/allbcaweb&quot; rel=&quot;nofollow&quot;&gt;@allbcaweb&lt;/a&gt;&lt;/strong&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on facebook)&lt;br /&gt;
&lt;strong&gt;Twitter =&amp;nbsp;&lt;a href=&quot;https://www.twitter.com/allbcaweb&quot; rel=&quot;nofollow&quot;&gt;@allbcaweb&lt;/a&gt;&lt;/strong&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Twitter)&lt;br /&gt;
&lt;b&gt;Email=&amp;nbsp;&lt;a href=&quot;mailto:allbca.com@gmail.com&quot;&gt;allbca.com@gmail.com&lt;/a&gt;&lt;br /&gt;Send us your query anytime about computer network notes!&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;External Links:&lt;/strong&gt;&lt;br /&gt;
Congestion Control &lt;a href=&quot;https://en.wikipedia.org/wiki/Network_congestion&quot;&gt;(link)&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
[Topics= 1.Congestion. 2.Congestion Control and its causes. 3.Difference between Congestion Control and Flow Control. 4.Congestion Control Algorithm. 5.How to measure performance of network.]
&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/704867865515582738'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/704867865515582738'/><link rel='alternate' type='text/html' href='https://www.allbca.com/2021/08/congestion-control-algorithm-its-causes.html' title='Congestion Control Algorithm &amp; its causes | Diff. Flow Contol'/><author><name>Mayank Rana</name><uri>http://www.blogger.com/profile/06163424302596650438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs9mOMQbRjoNrVnY7AbBycXEpeOG7szPXA2y_RbbeTVJ25GEGpq6q-gZxcoKqROoy4G51CI9ZCvXhjBXCUH8gb-MvrIfJnbBBdt4BY6sgH3zI2blMucgSoV-XQYw6d9g/s125/mayankrana.webp'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIFzEYeWhqrvf5PLq-bIxD9wTsQv-akJXUDjKc-yJKTYwgvyxxprUk6Am4sS_vG71ftNpxv0sts314AnR45foYM4szRuGIl5DsiAsm1DH39xIW81lG6xzkrHB8dq2i9q2Gf06cEffFTA/s72-c/Congestion-Control-in-computer-network-by-studywow.jpg" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5313576602653501716.post-6130334997207193883</id><published>2021-06-30T01:42:00.000+05:30</published><updated>2021-06-30T01:42:19.348+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="BCA-Sem-6th"/><title type='text'>Device Management | Protection and Security | Page Fault</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;Intro: Q1.&lt;/b&gt;What do you mean by &lt;b&gt;Device Management&lt;/b&gt; in operating System?&amp;nbsp;&lt;b&gt;Q2.&lt;/b&gt;What is &lt;b&gt;System, Protection and Security&lt;/b&gt; in operating System?&amp;nbsp;&lt;b&gt;Q3.When do Page Fault occur?&lt;/b&gt; Describe the &lt;b&gt;steps in handling a page fault&lt;/b&gt;?&amp;nbsp;&lt;strong&gt;(&lt;a href=&quot;https://www.allbca.com/2020/03/Operating-System-Notes-BCA.html&quot;&gt;Operating System all notes&lt;/a&gt;)&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-85CgNzqtvT19y8r5rPSxS9_uh3R2QR-pPfa7KUER0l7s5I4tz1OP-3HHnG8v74bUnJ5yu-M2XH738bSh5DrcxgVsusZdvO2CXw52UZSJAv5IPQtfG4EMdwjNzG8MkCS9FOvPtu21Dw/s1600/Device-Management-%2526-Protection-Security-%2526-Page-Fault.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Device-Management-&amp;amp;-Protection-Security-&amp;amp;-Page-Fault&quot; border=&quot;0&quot; data-original-height=&quot;600&quot; data-original-width=&quot;800&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-85CgNzqtvT19y8r5rPSxS9_uh3R2QR-pPfa7KUER0l7s5I4tz1OP-3HHnG8v74bUnJ5yu-M2XH738bSh5DrcxgVsusZdvO2CXw52UZSJAv5IPQtfG4EMdwjNzG8MkCS9FOvPtu21Dw/s640/Device-Management-%2526-Protection-Security-%2526-Page-Fault.webp&quot; title=&quot;Device-Management-&amp;amp;-Protection-Security-&amp;amp;-Page-Fault&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q1. What do you mean by Device Management in operating System?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans. Device Management:&lt;/strong&gt; Within the computer, activating and controlling the peripheral devices. In a desktop computer, the operating system interacts with the device drivers for peripheral control. In very small embedded systems, the device management routines may be included within the Operating System.&lt;br /&gt;
Configuring and deploying applications to the computing devices within an organization, such as desktop PCs, laptops, and mobile devices.&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;The Functions of Device Management:&lt;/span&gt;&lt;/h3&gt;
&lt;strong&gt;The following functions are used in device management:&lt;/strong&gt;&lt;br /&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;th&gt;Function&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Device I/O control&lt;/td&gt;&lt;td&gt;Sends a control code directly to a specified device driver.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Install new device&lt;/td&gt;&lt;td&gt;Installs a new device. The user is prompted to select the device.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Register device notification&lt;/td&gt;&lt;td&gt;Registers the device or type of device for which a window will receive notifications.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Unregister device notification&lt;/td&gt;&lt;td&gt;Closes the specified device notification handle.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q2. What is System, Protection and Security in operating System?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans. System:&lt;/strong&gt; System means a set of things working together as part of a mechanism or an interconnecting network, a complex whole.&lt;br /&gt;
&lt;strong&gt;Protection:&lt;/strong&gt; Protection is a mechanism that prevents accidental or intentional misuse of a system. Its aspects include authentication, authorization and access enforcement.&lt;br /&gt;
&lt;strong&gt;Security:&lt;/strong&gt; Security means to limit access to only what is absolutely needed. It involves logging, the principle of minimum privilege, absence of bugs, information flow control, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q3. When do Page Fault occur? Describe the steps in handling a page fault?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans. Page Fault:&lt;/strong&gt; A page fault is an exception that is raised by the memory management unit when a needed page is not mapped in physical memory. This exception is passed on to the operating system which will bring the required page into physical memory.&lt;br /&gt;
&lt;br /&gt;
An interrupt that occurs when a program requests data that is not currently in real memory. The interrupt triggers the operating system to fetch the data from virtual memory and load it into RAM.&lt;br /&gt;
&lt;br /&gt;
An invalid page fault or page fault error occurs when the operating system cannot find the data in virtual memory. This usually happens when the virtual memory area or the table that maps virtual addresses to real addresses becomes corrupt.&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;Steps in Handling a Page Fault&lt;/span&gt;&lt;/h3&gt;
&lt;strong&gt;1.&lt;/strong&gt; We check an internal table kept with the process control block for this process to determine if the reference was invalid or in-valid memory access. If it was invalid, we terminate the program.&lt;br /&gt;
&lt;strong&gt;2.&lt;/strong&gt; If it was a valid reference, but we have not yet brought on that page we must now bring it in.&lt;br /&gt;
&lt;strong&gt;3.&lt;/strong&gt; Find a free frame.&lt;br /&gt;
&lt;strong&gt;4.&lt;/strong&gt; Schedule a disk-operation to read the desired page into the newly allocated frame.&lt;br /&gt;
&lt;strong&gt;5.&lt;/strong&gt; When the disk read a complete, modified the internal table kept with the process and the page-table to indicate the page is now in memory.&lt;br /&gt;
&lt;strong&gt;6.&lt;/strong&gt; Restart the instruction that was interrupted by the illegal address trap the process can now access the page as if it had always been in memory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #cccccc;&quot;&gt;[ Topic= Device Management in operating System,&amp;nbsp; Protection and Security &amp;nbsp;in operating system ]&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: purple;&quot;&gt;External Links:-&lt;/span&gt;&lt;/h3&gt;
1. Device Management in operating System - (&lt;a href=&quot;https://www.slideshare.net/DamianGordon1/operating-systems-device-management&quot; target=&quot;_blank&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
2. Protection and Security &amp;nbsp;in operating system - (&lt;a href=&quot;https://www.tutorialspoint.com/operating_system/os_security.htm&quot; target=&quot;_blank&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
3. When do Page Fault occur - (&lt;a href=&quot;https://en.wikipedia.org/wiki/Page_fault&quot; target=&quot;_blank&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #eeeeee;&quot;&gt;[ Topic= Device Management in operating System,&amp;nbsp; Protection and Security &amp;nbsp;in operating system ]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #eeeeee;&quot;&gt;[ Topic= Device Management in operating System,&amp;nbsp; Protection and Security &amp;nbsp;in operating system ]&lt;/span&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/6130334997207193883'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/6130334997207193883'/><link rel='alternate' type='text/html' href='https://www.allbca.com/2020/05/device-management-protection-security-and-page-fault.html' title='Device Management | Protection and Security | Page Fault'/><author><name>Mayank Rana</name><uri>http://www.blogger.com/profile/06163424302596650438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs9mOMQbRjoNrVnY7AbBycXEpeOG7szPXA2y_RbbeTVJ25GEGpq6q-gZxcoKqROoy4G51CI9ZCvXhjBXCUH8gb-MvrIfJnbBBdt4BY6sgH3zI2blMucgSoV-XQYw6d9g/s125/mayankrana.webp'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-85CgNzqtvT19y8r5rPSxS9_uh3R2QR-pPfa7KUER0l7s5I4tz1OP-3HHnG8v74bUnJ5yu-M2XH738bSh5DrcxgVsusZdvO2CXw52UZSJAv5IPQtfG4EMdwjNzG8MkCS9FOvPtu21Dw/s72-c/Device-Management-%2526-Protection-Security-%2526-Page-Fault.webp" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5313576602653501716.post-4996556077705847179</id><published>2021-06-30T01:41:00.000+05:30</published><updated>2021-06-30T01:41:37.024+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer-Graphics"/><title type='text'>Computer Animation - Types, Methods, Applications, Softwares</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;a href=&quot;https://www.allbca.com/2020/03/Computer-Graphics-Multimedia-Application-CGMA.html&quot;&gt;&lt;strong&gt;Computer Graphics and Multimedia Application&lt;/strong&gt;&lt;/a&gt;: Q1.&lt;strong&gt;Animation or Computer Animation&lt;/strong&gt;? -Methods, Applications Q2.&lt;strong&gt;Types of Computer Animation&lt;/strong&gt;? Q3.&lt;strong&gt;Softwares used for Computer Animation&lt;/strong&gt;? &lt;strong&gt;(&lt;a href=&quot;https://www.allbca.com/search/label/Computer-Graphics&quot;&gt;Computer graphics and multimedia application All Notes&lt;/a&gt;)&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWHnxYQadyyrrLaSV3yqrN30mJbIw8gJJMnRI9aeWRTd4FVLnyLLem54QEVZqj34HMOMY0lrBFeRFzvcBzX9rSdcDOZCWi6hqPzXGeZs2MevSSGI6O05yheou09I4yD4cwtp9ryJxd2Q/s1600/Computer-Animation-www.allbca.com.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Computer-Animation-www.allbca.com&quot; border=&quot;0&quot; data-original-height=&quot;600&quot; data-original-width=&quot;800&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWHnxYQadyyrrLaSV3yqrN30mJbIw8gJJMnRI9aeWRTd4FVLnyLLem54QEVZqj34HMOMY0lrBFeRFzvcBzX9rSdcDOZCWi6hqPzXGeZs2MevSSGI6O05yheou09I4yD4cwtp9ryJxd2Q/s640/Computer-Animation-www.allbca.com.webp&quot; title=&quot;Computer-Animation-www.allbca.com&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q1. What do you mean by Computer Animation? Explain the various methods of computer animation? Or What is animation? Also explain its applications?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans.&lt;/strong&gt; It will not be an exaggeration to say that animation can bring the dullest of the features to life. It has the magic of injecting energy and emotions into the most seemingly in animate objects. Over the years the advancement of technology has made animation, a very attractive and much sought after component of multimedia.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;1. What is Animation?&lt;/span&gt;&lt;/h3&gt;
Animating is moving something that cannot move on its own. Animation adds to graphics the dimensions of time, which tremendously increase the potential of transmitting the desired information. In order to animate something, the animator has to be able to specify directly or indirectly how the &#39;thing&#39; has to move through time and pace.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;2. Traditional Methods&lt;/span&gt;&lt;/h3&gt;
As is evident from the history, animators have used and invented a variety of different animation techniques. Traditionally most of the animation was done by hand. All the frames in an animation had to be drawn by hand.&lt;br /&gt;
Since each second of animation requires 24 frames (film), the amount of work required to create even the shortest of movies, can be tremendous. Some of the traditionally used methods are described below :&lt;br /&gt;
&lt;h4&gt;
&lt;span style=&quot;color: #003300;&quot;&gt;(i) Keyframes&lt;/span&gt;&lt;/h4&gt;
In this technique a storyboard is laid out and then the artists draw the major frames of the animation. These major frames are in which a lot of changes take place. They are the key points of animation. Later a bunch of artists draw in the frames in-between. This technique is, of course, very time and effort-intensive.&lt;br /&gt;
&lt;h4&gt;
&lt;span style=&quot;color: #003300;&quot;&gt;(ii) Cel Animation&lt;/span&gt;&lt;/h4&gt;
In this technique each character is drawn on a separate piece of opaque paper. Then, at the time of shooting animation, the different characters are overlaid on top of the background in each frame. This is relatively a less tedious process, as the artists do not have to draw in entire frames but just the parts that need to change such as individual character.&lt;br /&gt;
&lt;h4&gt;
&lt;span style=&quot;color: #003300;&quot;&gt;(iii) Rotascoping&lt;/span&gt;&lt;/h4&gt;
Rotascoping is a technique where images are copied from a moving video into an animation. The animator draws the motion and shape of the object by referring to the video as opposed to imagining in his head.&lt;br /&gt;
With the help of the rotoscoping one can animate some complex scenes that would be hard to visualize otherwise.The disadvantage is that one will have to hunt for the exact video that one wants to animate.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;3. Computer Animation&lt;/span&gt;&lt;/h3&gt;
&lt;strong&gt;Computer Animation:&lt;/strong&gt; With time the methods of animation have become more and more computer-assisted and computer-generated. All of such techniques require a trade-off between the level of control that the animator has over the finer details of the motion and the amount of work that the computer does on its own.&lt;br /&gt;
&lt;br /&gt;
Broadly, the computer animation falls into three basic categories: &lt;strong&gt;keyframing, motion capture and simulation&lt;/strong&gt;.&lt;br /&gt;
&lt;h4&gt;
&lt;span style=&quot;color: #003300;&quot;&gt;(i) Keyframing&lt;/span&gt;&lt;/h4&gt;
The significance of the term “Keyframing&quot; can be traced back to traditional hand animation method. Keyframing requires that the animator specify critical or key positions for the objects. The computer then automatically fills in the missing frames by smoothly interpolating between those positions.&lt;br /&gt;
&lt;br /&gt;
The characters for a movie called Toy Story made in 1995 were designed through key frame animation. It is believed that each character had as many as 700 controls.&lt;br /&gt;
&lt;br /&gt;
Keyframing requires that the animator has a well thought out plan of how the moving objects are going to behave over time as well as the talent to express that information through keyframed information.&lt;br /&gt;
The continued popularity of keyframing is a function of the degree of control that it allows the animator to exercise over the subtle details of the motion.&lt;br /&gt;
&lt;br /&gt;
Another method is motion capture, in which magnetic or vision-based sensors record the actions of a human or animal object in three dimensions. A computer then uses these data to animate the object.&lt;br /&gt;
&lt;br /&gt;
This technology has enabled a number of famous athletes to supply the actions for characters in sports video games.&lt;br /&gt;
Motion capture is pretty popular with the animators mainly because some of the common place human actions can be captured with relative ease. However, there can be serious discrepancies between the shapes or dimensions of the subject and the graphical character and this may lead to problems of exact execution.&lt;br /&gt;
&lt;h4&gt;
&lt;span style=&quot;color: #003300;&quot;&gt;(ii) Simulation&lt;/span&gt;&lt;/h4&gt;
Unlike keyframing and motion picture, simulation uses the laws of physics to generate motion of figures and other objects. Virtual humans are usually represented as a collection of rigid body parts. These models though physically possible are only an approximation of the human body.&lt;br /&gt;
&lt;br /&gt;
With more research and complex models the simulations are becoming increasingly lifelike. Simulations can be easily used to produce slightly different sequences while maintaining physical realism while in other animations like keyframing or motion capture a mere speeding up or slowing down the playback can spoil the naturalness of motion.&lt;br /&gt;
&lt;br /&gt;
Secondly real time simulations allow a higher degree of interactivity where the real person can maneuver the actions of the simulated character. In contrast the applications based on keyframing and motion select and modify motions from a precomputed library of motions. One drawback that simulation suffers from is the expertise and time required to handcraft the appropriate controls systems.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;4. Applications of Animation&lt;/span&gt;&lt;/h3&gt;
There are a variety of uses for computer animation.&lt;br /&gt;
They can range from fun to practical and educational ones.&lt;br /&gt;
&lt;strong&gt;(i)&lt;/strong&gt; Education,&lt;br /&gt;
&lt;strong&gt;(ii)&lt;/strong&gt; Engineering,&lt;br /&gt;
&lt;strong&gt;(iii)&lt;/strong&gt; Flight simulation,&lt;br /&gt;
&lt;strong&gt;(iv)&lt;/strong&gt; Medicine,&lt;br /&gt;
&lt;strong&gt;(iv)&lt;/strong&gt; Military.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: white;&quot;&gt;[ Topic= Computer Animation ]&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q2. Different Types of Computer Animation?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans. There are two types of computer animation such as :&lt;/strong&gt;&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;1. 2D Animation:&lt;/span&gt;&lt;/h3&gt;
2D animation figures are created and/or edited on the computer using 2D bitmap graphics or created and edited using 2D vector graphics. This includes automated computerized versions of traditional animation techniques such as of, interpolated morphing, onion skinning and interpolated rotoscoping.&lt;br /&gt;
&lt;br /&gt;
2D animation has many applications, including analog computer animation, Flash animation and PowerPoint animation. Cinemagraphs are still photographs in the form of an animated GIF file of which part is animated.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;2. 3D Animation:&lt;/span&gt;&lt;/h3&gt;
3D animation is digitally modelled and manipulated by an animator. The animator starts by creating an external 3D mesh to manipulate. A mesh is a geometric configuration that gives the visual appearance of form to a 3D object or 3D environment.&lt;br /&gt;
&lt;br /&gt;
The mesh may have many vertices which are the geometric points which make up the mesh; it is given an internal digital skeletal structure called an armature that can be used to control the mesh with weights. This process is called rigging and can be programmed with movement with keyframes.&lt;br /&gt;
&lt;br /&gt;
Other techniques can be applied, such as mathematical functions (e.g. gravity, particle simulations), simulated fur or hair, effects such as fire and water simulations. These techniques fall under the category of 3D dynamics.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: white;&quot;&gt;[ Topic= Computer Animation ]&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q3. Softwares used for Computer Animation?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans.&lt;/strong&gt; Example of software packages which are popular software packages used by the companies, schools and individuals all around the globe include some of the following:&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;(i) 3D Studio Max:&lt;/strong&gt; The successor to 3D Studio 3.0. 3D Studio Max runs under Windows NT. It is entirely object oriented, featuring new improvements, such as volumetric lighting, spacewarps and all new redesigned interface.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;(ii) Light Wave 3D :&lt;/strong&gt; Light Wave 3D is another high end PC 3D computer software package. Originally developed for the Amiga platform, it&#39;s considered the best 3D product for the PC. This software has been used for quite a few television productions such as Babylon 5 and SeaQuest.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;(iii) Adobe Premiere:&lt;/strong&gt; Adobe Premiere is a tool that is used to composite digitized video, stills and apply a variety of transitions and special effects. Adobe Premiere runs both on Mac and Windows PC.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;(iv) Strata Studio Pro :&lt;/strong&gt; Strata Studio Pro is probably known the most known 3D graphics application on the Mac. Created by Strata Inc. Strata Studio Pro is mainly a still graphic rendering application, but it does have animation capabilities.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;(v) Alias I Wavefront:&lt;/strong&gt; Alias is one of the topmost animation packages in the market. Produced by two companies. Alias and Wavefront who work in collaboration, it runs on the SGI&#39;s. Alias is well known for it&#39;s great modeler which is capable of modelling some of the most complicated objects. Also, this software package is very flexible allowing programmers that will allow the programmers to create software that will run in tandem.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;[ Topic= Computer Animation ]&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: #f3f3f3;&quot;&gt;[ Topic= Computer Animation ]&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Join us on Facebook, Instagram, and Twitter to get the latest study material. You can also ask us any questions.&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;Facebook =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;a href=&quot;https://www.fb.com/allbcaweb&quot; rel=&quot;nofollow&quot; style=&quot;color: blue;&quot;&gt;@allbcaweb&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Facebook)&lt;br /&gt;
&lt;b&gt;Instagram&lt;/b&gt; = &lt;a href=&quot;https://www.instagram.com/allbcaweb/&quot; rel=&quot;nofollow noopener noreferrer&quot; target=&quot;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;@allbcaweb&lt;/b&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Instagram)&lt;br /&gt;
&lt;strong&gt;Twitter =&amp;nbsp;&lt;span style=&quot;color: #00ccff;&quot;&gt;&lt;a href=&quot;https://www.twitter.com/allbcaweb&quot; rel=&quot;nofollow&quot; style=&quot;color: #00ccff;&quot;&gt;@allbcaweb&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Twitter)&lt;br /&gt;
&lt;b&gt;Email=&amp;nbsp;&lt;a href=&quot;mailto:allbca.com@gmail.com&quot;&gt;allbca.com@gmail.com&lt;/a&gt;&lt;br /&gt;Send us your query anytime about Computer Animation!&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: #f3f3f3;&quot;&gt;[ Topic= Computer Animation ]&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: #993366;&quot;&gt;External Links:-&lt;/span&gt;&lt;/h3&gt;
1. Computer Animation - (&lt;a href=&quot;https://en.wikipedia.org/wiki/Computer_animation&quot; target=&quot;_blank&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
2. Computer Animation - (&lt;a href=&quot;https://www.tutorialspoint.com/computer_graphics/computer_animation.htm&quot; target=&quot;_blank&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #f3f3f3;&quot;&gt;[ Topic= Computer Animation ]&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;[ Topic= Computer Animation ]&lt;/b&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/4996556077705847179'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/4996556077705847179'/><link rel='alternate' type='text/html' href='https://www.allbca.com/2020/04/computer-animation.html' title='Computer Animation - Types, Methods, Applications, Softwares'/><author><name>Mayank Rana</name><uri>http://www.blogger.com/profile/06163424302596650438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs9mOMQbRjoNrVnY7AbBycXEpeOG7szPXA2y_RbbeTVJ25GEGpq6q-gZxcoKqROoy4G51CI9ZCvXhjBXCUH8gb-MvrIfJnbBBdt4BY6sgH3zI2blMucgSoV-XQYw6d9g/s125/mayankrana.webp'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWHnxYQadyyrrLaSV3yqrN30mJbIw8gJJMnRI9aeWRTd4FVLnyLLem54QEVZqj34HMOMY0lrBFeRFzvcBzX9rSdcDOZCWi6hqPzXGeZs2MevSSGI6O05yheou09I4yD4cwtp9ryJxd2Q/s72-c/Computer-Animation-www.allbca.com.webp" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5313576602653501716.post-6577638991831364577</id><published>2021-06-30T01:40:00.000+05:30</published><updated>2021-06-30T01:40:52.101+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer-Graphics"/><title type='text'>DDA Algorithm - DDA Line Drawing Algorithm</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;a href=&quot;https://www.allbca.com/2020/03/Computer-Graphics-Multimedia-Application-CGMA.html&quot;&gt;&lt;strong&gt;Computer Graphics and Multimedia Application&lt;/strong&gt;&lt;/a&gt;: Q1.&lt;strong&gt;What is DDA&lt;/strong&gt;? or &lt;strong&gt;DDA Algorithm&lt;/strong&gt;? Q2.&lt;strong&gt;Advantages and Disadvantages of DDA&lt;/strong&gt;? &lt;strong&gt;(&lt;a href=&quot;https://www.allbca.com/search/label/Computer-Graphics&quot;&gt;Computer graphics and multimedia application All Notes&lt;/a&gt;)&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirBVbbg9Ei_ZdZgr4q_QRBrLvuTqz8tT7-b0vrE4afQIfUfn9QaRuYuKYI1CtEhb3l3FunQRjYEcKz1qMXWoGQSPKpIUaMa0xzyEA_qvmRyGIPih2uwMqzEglQMjxAMn3dNcpc4FwXSQ/s1600/computer-graphics-dda-algorithm-www.allbca.com.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;computer-graphics-dda-algorithm-www.allbca.com&quot; border=&quot;0&quot; data-original-height=&quot;600&quot; data-original-width=&quot;800&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirBVbbg9Ei_ZdZgr4q_QRBrLvuTqz8tT7-b0vrE4afQIfUfn9QaRuYuKYI1CtEhb3l3FunQRjYEcKz1qMXWoGQSPKpIUaMa0xzyEA_qvmRyGIPih2uwMqzEglQMjxAMn3dNcpc4FwXSQ/s640/computer-graphics-dda-algorithm-www.allbca.com.webp&quot; title=&quot;computer-graphics-dda-algorithm-www.allbca.com&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Q1. What do you mean by DDA in the scan-conversion line? or DDA Algorithm?&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt; DDA Line Drawing Algorithm?&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans.&lt;/strong&gt; DDA stands for a digital differential analyzer. DDA is a scan-conversion line algorithm based on calculating either 𐤃y or 𐤃x. We sample the line at unit intervals in one coordinate and determine corresponding integer values nearest the line path for other co-ordinates.&lt;br /&gt;
&lt;br /&gt;
Consider first line with positive slope, if the slope is less than or equal to 1, we sample at unit x internal (𐤃x = 1) and compute each successive y value as :&lt;br /&gt;
&lt;br /&gt;
y&lt;sub&gt;k+1&lt;/sub&gt; = y&lt;sub&gt;k&lt;/sub&gt; + m&lt;br /&gt;
&lt;br /&gt;
Subscript k takes integer values starting from 1, for the first point and increases by 1 unit the final endpoint is reached. Since m can be any real number between 0 and 1, the calculated y values must be rounded to the nearest integer.&lt;br /&gt;
&lt;br /&gt;
For line with a positive slope greater than 1, we reverse the role of x and y .i.e.we sample at unit y interval (𐤃y = 1) and calculate each succeeding x value as :&lt;br /&gt;
&lt;br /&gt;
x&lt;sub&gt;k+1&lt;/sub&gt; = x&lt;sub&gt;k &lt;/sub&gt;+ 1/m&lt;br /&gt;
&lt;br /&gt;
Both equations is based on the assumption that lines are to be processed from the left endpoint to the right endpoint. If this processing is reversed, so that the starting endpoint is at right, then either we have 𐤃x = -1 and&lt;br /&gt;
&lt;br /&gt;
y&lt;sub&gt;k+1&lt;/sub&gt; = y&lt;sub&gt;k&lt;/sub&gt; - m&lt;br /&gt;
&lt;br /&gt;
or, when the slope is greater than 1, we have 𐤃y = -1 with&lt;br /&gt;
&lt;br /&gt;
x&lt;sub&gt;k+1&lt;/sub&gt; = x&lt;sub&gt;k -&lt;/sub&gt;&amp;nbsp;1/m&lt;br /&gt;
&lt;br /&gt;
This algorithm is summarised in the following procedure, which accepts as input two endpoint pixel positions. The horizontal and vertical difference between the endpoint position are assigned to parameters dx and dy.&lt;br /&gt;
&lt;br /&gt;
The DDA algorithm is a faster method for calculating pixel positions. It eliminates the multiplication by making use of raster and characteristics, so that appropriate increment is applied in the x or y direction to step to pixel position along the path line.&lt;br /&gt;
&lt;br /&gt;
The accumulation of roundoff error in successive additions of the floating-point increment, however, can cause the calculated pixel positions to draft way from the true line path for the long line segment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q2. Write down the advantages and disadvantages of DDA?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans. &lt;span style=&quot;color: red;&quot;&gt;The advantages of DDA are as follows:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;(a)&lt;/strong&gt; Faster than the direct use of the line equation.&lt;br /&gt;
&lt;strong&gt;(b)&lt;/strong&gt; It does not do any floating point multiplication.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: red;&quot;&gt;The disadvantages of DDA are as follows: &lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;(a)&lt;/strong&gt; It drift away from the actual line path because of rounding it float value integer.&lt;br /&gt;
&lt;strong&gt;(b)&lt;/strong&gt; It causes stain-step effect.&lt;br /&gt;
&lt;strong&gt;(c)&lt;/strong&gt; Floating point addition is still needed.&lt;br /&gt;
&lt;strong&gt;(d)&lt;/strong&gt; Precision loss because of rounding off.&lt;br /&gt;
&lt;strong&gt;(e)&lt;/strong&gt; Pixels drift farther apart if line is relatively larger.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;[ Topic= DDA Algorithm, DDA Line Drawing Algorithm ]&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Join us on Facebook, Instagram, and Twitter to get the latest study material. You can also ask us any questions.&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;Facebook =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;a href=&quot;https://www.fb.com/allbcaweb&quot; rel=&quot;nofollow&quot; style=&quot;color: blue;&quot;&gt;@allbcaweb&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Facebook)&lt;br /&gt;
&lt;b&gt;Instagram&lt;/b&gt; = &lt;a href=&quot;https://www.instagram.com/allbcaweb/&quot; rel=&quot;nofollow noopener noreferrer&quot; target=&quot;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;@allbcaweb&lt;/b&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Instagram)&lt;br /&gt;
&lt;strong&gt;Twitter =&amp;nbsp;&lt;span style=&quot;color: #00ccff;&quot;&gt;&lt;a href=&quot;https://www.twitter.com/allbcaweb&quot; rel=&quot;nofollow&quot; style=&quot;color: #00ccff;&quot;&gt;@allbcaweb&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Twitter)&lt;br /&gt;
&lt;b&gt;Email=&amp;nbsp;&lt;a href=&quot;mailto:allbca.com@gmail.com&quot;&gt;allbca.com@gmail.com&lt;/a&gt;&lt;br /&gt;Send us your query anytime about DDA Algorithm!&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: #993366;&quot;&gt;External Links:-&lt;/span&gt;&lt;/h3&gt;
1. DDA Algorithm - (&lt;a href=&quot;https://www.javatpoint.com/computer-graphics-dda-algorithm&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
2. DDA Line Drawing Algorithm - (&lt;a href=&quot;https://www.geeksforgeeks.org/dda-line-generation-algorithm-computer-graphics/&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;[ Topic= DDA Algorithm, DDA Line Drawing Algorithm ]&lt;/b&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/6577638991831364577'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/6577638991831364577'/><link rel='alternate' type='text/html' href='https://www.allbca.com/2020/04/computer-graphics-dda-algorithm.html' title='DDA Algorithm - DDA Line Drawing Algorithm'/><author><name>Mayank Rana</name><uri>http://www.blogger.com/profile/06163424302596650438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs9mOMQbRjoNrVnY7AbBycXEpeOG7szPXA2y_RbbeTVJ25GEGpq6q-gZxcoKqROoy4G51CI9ZCvXhjBXCUH8gb-MvrIfJnbBBdt4BY6sgH3zI2blMucgSoV-XQYw6d9g/s125/mayankrana.webp'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirBVbbg9Ei_ZdZgr4q_QRBrLvuTqz8tT7-b0vrE4afQIfUfn9QaRuYuKYI1CtEhb3l3FunQRjYEcKz1qMXWoGQSPKpIUaMa0xzyEA_qvmRyGIPih2uwMqzEglQMjxAMn3dNcpc4FwXSQ/s72-c/computer-graphics-dda-algorithm-www.allbca.com.webp" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5313576602653501716.post-4928000316907688845</id><published>2021-06-30T01:00:00.000+05:30</published><updated>2021-06-30T01:00:43.721+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer-Graphics"/><title type='text'>Polygon Clipping | Polygon | Sutherland Hodgeman Algorithm</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;strong&gt;Computer Graphics and Multimedia Application&lt;/strong&gt;: Q1.&lt;strong&gt;What is &lt;a href=&quot;#poly&quot;&gt;Polygon and Types of Polygon&lt;/a&gt;&lt;/strong&gt;? Q2.&lt;strong&gt;What is &lt;a href=&quot;#pclip&quot;&gt;Polygon Clipping&lt;/a&gt;&lt;/strong&gt;? &lt;strong&gt;&lt;a href=&quot;#sh&quot;&gt;Sutherland Hodgeman&lt;/a&gt; polygon clipping algorithm&lt;/strong&gt;? &lt;strong&gt;(&lt;a href=&quot;https://www.allbca.com/2020/03/Computer-Graphics-Multimedia-Application-CGMA.html&quot;&gt;Computer graphics and multimedia application All Notes&lt;/a&gt;)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;
&lt;hr /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPS2mW191UrdEUBNTbZMGy7de1pQyvPbHMTy5KhfQ7WMMd_1nVa_iRaA56pA94EgPK8qFzeAmAxYuvtrkOYB1hOKysgMV40IlYSgWjRJCNhPxuIQcRnvPVqpsFu7jCl-xtwlLEgIR3zQ/s1600/polygon-clipping-sutherland-hodgeman-algorithm.webp&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;polygon-clipping-sutherland-hodgeman-algorithm&quot; border=&quot;0&quot; data-original-height=&quot;600&quot; data-original-width=&quot;800&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPS2mW191UrdEUBNTbZMGy7de1pQyvPbHMTy5KhfQ7WMMd_1nVa_iRaA56pA94EgPK8qFzeAmAxYuvtrkOYB1hOKysgMV40IlYSgWjRJCNhPxuIQcRnvPVqpsFu7jCl-xtwlLEgIR3zQ/s640/polygon-clipping-sutherland-hodgeman-algorithm.webp&quot; title=&quot;polygon-clipping-sutherland-hodgeman-algorithm&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2 id=&quot;poly&quot;&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q1. What is Polygon and also explain all Types of Polygon?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans.&lt;/strong&gt; A polygon is a closed planar path composed of a finite number of sequential line segments.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;There are two types of polygon: &lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;(1)&lt;/strong&gt; Convex polygon, &lt;strong&gt;(ii)&lt;/strong&gt; Concave polygon.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;(i) Convex Polygon:&lt;/strong&gt; The line connecting two interior points of the polygon lies completely inside the polygon. It is said to be convex polygon. A convex polygon has all its interior angle less than 180°.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKx83WQic1cEf6t8cazd_ux2d-lZugZqDdf9cLzgn_V09Ac4nVgaEcz786tv-RrB8PRbVrN22-vo4HRqw8Rc0UP80ydwGwUc4xE8tEC41nPsUkDcktZyB6SpuZ93W6-J9NY5CEFCa8nQ/s1600/Convex-Polygon-in-computer-graphics.webp&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Convex-Polygon-in-computer-graphics&quot; border=&quot;0&quot; data-original-height=&quot;628&quot; data-original-width=&quot;1600&quot; height=&quot;250&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKx83WQic1cEf6t8cazd_ux2d-lZugZqDdf9cLzgn_V09Ac4nVgaEcz786tv-RrB8PRbVrN22-vo4HRqw8Rc0UP80ydwGwUc4xE8tEC41nPsUkDcktZyB6SpuZ93W6-J9NY5CEFCa8nQ/s640/Convex-Polygon-in-computer-graphics.webp&quot; title=&quot;Convex-Polygon-in-computer-graphics&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;strong&gt;(ii) Concave Polygon:&lt;/strong&gt; The polygon that is not convex is called concave polygon, i.e. line joining any two interior points of the polygon is not completely inside the polygon as shown in the figure.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMgy-ogV7sQj1HfurT_J2KKv4GWvGO6eoUCgGPt4qoJTH2GxYaNrBX9xOdVic_F3-7P3JF_Z6WwU546IH75pm8jq0boZO1T3QZcFP_Z6bfHeYLWKrAm2muKn1OiA4Zeg686rGbASfv2w/s1600/Concave-Polygon-in-computer-graphics.webp&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Concave-Polygon-in-computer-graphics&quot; border=&quot;0&quot; data-original-height=&quot;580&quot; data-original-width=&quot;1600&quot; height=&quot;232&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMgy-ogV7sQj1HfurT_J2KKv4GWvGO6eoUCgGPt4qoJTH2GxYaNrBX9xOdVic_F3-7P3JF_Z6WwU546IH75pm8jq0boZO1T3QZcFP_Z6bfHeYLWKrAm2muKn1OiA4Zeg686rGbASfv2w/s640/Concave-Polygon-in-computer-graphics.webp&quot; title=&quot;Concave-Polygon-in-computer-graphics&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;hr /&gt;
&lt;h2 id=&quot;pclip&quot;&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q2. What is Polygon Clipping? Sutherland Hodgeman polygon clipping algorithm?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans.&lt;/strong&gt; A polygon boundary processed with a line clipper may be displayed as a series of unconnected line segments, depending on the orientation of the polygon to the clipping window. For polygon clipping,&lt;br /&gt;
&lt;br /&gt;
We require an algorithm that will generate one or more closed areas that are then scan converted for the appropriate area. The output of a polygon clipper should be a sequence of vertices that defines the clipped polygon boundaries.&lt;br /&gt;&lt;hr /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLWvk9nvveFdYZbYNd-qcNLgipig-Q3EBFdxPM1fz87WdGE5APAX8IJrju2wzv6kFEJTgM4j21Oi7oZjbW0EYAqKwQG9v6cYFXFD5H8bpNnKaCTMobwNyByReEanYj4ES6SSnEN_ut1A/s1600/Polygon-Clipping-in-computer-graphics.webp&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Polygon-Clipping-in-computer-graphics&quot; border=&quot;0&quot; data-original-height=&quot;833&quot; data-original-width=&quot;1600&quot; height=&quot;332&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLWvk9nvveFdYZbYNd-qcNLgipig-Q3EBFdxPM1fz87WdGE5APAX8IJrju2wzv6kFEJTgM4j21Oi7oZjbW0EYAqKwQG9v6cYFXFD5H8bpNnKaCTMobwNyByReEanYj4ES6SSnEN_ut1A/s640/Polygon-Clipping-in-computer-graphics.webp&quot; title=&quot;Polygon-Clipping-in-computer-graphics&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;
&lt;h3 id=&quot;sh&quot;&gt;
&lt;span style=&quot;color: red;&quot;&gt;Sutherland Hodgeman Polygon Clipping Algorithm:&lt;/span&gt;&lt;/h3&gt;
We can correctly clip a polygon by processing the polygon boundary as a while against each window edge. This could be accomplished by processing all polygon vertices against each clip rectangle boundary in turn.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;There are four possible cases when processing vertices in sequence around the perimeter of a polygon:&lt;/b&gt;&lt;br /&gt;
&lt;strong&gt;1.&lt;/strong&gt; If the first vertices passed to a window boundary and the second vertex is inside, both the intersection point of polygon edge with the window boundary and the second vertex are added to the output vertex list.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;2.&lt;/strong&gt; If both input vertices inside the window boundary, only the second vertex added to the output vertex list.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;3.&lt;/strong&gt; If the first vertex is inside the window boundary and the second vertex is outside the window boundary, only the edge intersection with the window boundary is added to output vertex first.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;4.&lt;/strong&gt; It both input vertices are outside the window boundary, nothing is added to the output list.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC57rLRoblnNAAjXZQy-diIslWyAMYnH3cHlWDT6w_qd0xD1rnOCFhOVqBOzygFZulLYzcbfBoIqkBansRrhK8RMFNMOXy8RAGj-0uqmY6DFxpiHBPK9G4yHa_JPoKaA1IXJ8N5egReA/s1600/sutherland-hodgeman-algorithm-in-computer-graphics.webp&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;sutherland-hodgeman-algorithm-in-computer-graphics&quot; border=&quot;0&quot; data-original-height=&quot;522&quot; data-original-width=&quot;1600&quot; height=&quot;208&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgC57rLRoblnNAAjXZQy-diIslWyAMYnH3cHlWDT6w_qd0xD1rnOCFhOVqBOzygFZulLYzcbfBoIqkBansRrhK8RMFNMOXy8RAGj-0uqmY6DFxpiHBPK9G4yHa_JPoKaA1IXJ8N5egReA/s640/sutherland-hodgeman-algorithm-in-computer-graphics.webp&quot; title=&quot;sutherland-hodgeman-algorithm-in-computer-graphics&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;b&gt;
  Next Topic : &lt;a href=&quot;https://www.allbca.com/2020/04/clipping-types-in-computer-graphics.html&quot; target=&quot;_blank&quot;&gt;Clipping - Types of Clipping in Computer Graphics&lt;/a&gt;&lt;/b&gt;&lt;hr /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;hr /&gt;
&lt;strong&gt;Join us on Facebook, Instagram, and Twitter to get the latest study material. You can also ask us any questions.&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;Facebook =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;a href=&quot;https://www.fb.com/allbcaweb&quot; rel=&quot;nofollow&quot; style=&quot;color: blue;&quot;&gt;@allbcaweb&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Facebook)&lt;br /&gt;
&lt;b&gt;Instagram&lt;/b&gt; = &lt;a href=&quot;https://www.instagram.com/allbcaweb/&quot; rel=&quot;nofollow noopener noreferrer&quot; target=&quot;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;@allbcaweb&lt;/b&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Instagram)&lt;br /&gt;
&lt;strong&gt;Twitter =&amp;nbsp;&lt;span style=&quot;color: #00ccff;&quot;&gt;&lt;a href=&quot;https://www.twitter.com/allbcaweb&quot; rel=&quot;nofollow&quot; style=&quot;color: #00ccff;&quot;&gt;@allbcaweb&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Twitter)&lt;br /&gt;
&lt;b&gt;Email=&amp;nbsp;&lt;a href=&quot;mailto:allbca.com@gmail.com&quot;&gt;allbca.com@gmail.com&lt;/a&gt;&lt;br /&gt;Send us your query anytime about Polygon Clipping!&lt;/b&gt;&lt;br /&gt;
&lt;hr /&gt;&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: #993366;&quot;&gt;External Links:-&lt;/span&gt;&lt;/h3&gt;
1. Polygon Clipping - (&lt;a href=&quot;https://www.geeksforgeeks.org/polygon-clipping-sutherland-hodgman-algorithm-please-change-bmp-images-jpeg-png/&quot; target=&quot;_blank&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
2. Sutherland Hodgeman polygon clipping algorithm - (&lt;a href=&quot;https://en.wikipedia.org/wiki/Sutherland%E2%80%93Hodgman_algorithm&quot; target=&quot;_blank&quot;&gt;click here&lt;/a&gt;)&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/4928000316907688845'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/4928000316907688845'/><link rel='alternate' type='text/html' href='https://www.allbca.com/2020/04/polygon-clipping-sutherland-hodgeman-algorithm.html' title='Polygon Clipping | Polygon | Sutherland Hodgeman Algorithm'/><author><name>Mayank Rana</name><uri>http://www.blogger.com/profile/06163424302596650438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs9mOMQbRjoNrVnY7AbBycXEpeOG7szPXA2y_RbbeTVJ25GEGpq6q-gZxcoKqROoy4G51CI9ZCvXhjBXCUH8gb-MvrIfJnbBBdt4BY6sgH3zI2blMucgSoV-XQYw6d9g/s125/mayankrana.webp'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPS2mW191UrdEUBNTbZMGy7de1pQyvPbHMTy5KhfQ7WMMd_1nVa_iRaA56pA94EgPK8qFzeAmAxYuvtrkOYB1hOKysgMV40IlYSgWjRJCNhPxuIQcRnvPVqpsFu7jCl-xtwlLEgIR3zQ/s72-c/polygon-clipping-sutherland-hodgeman-algorithm.webp" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5313576602653501716.post-4501385978427008826</id><published>2021-06-30T00:26:00.005+05:30</published><updated>2021-06-30T14:11:11.546+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer-Graphics"/><title type='text'>Clipping - Types of Clipping in Computer Graphics</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;strong&gt;Computer Graphics and Multimedia Application&lt;/strong&gt;: Q1.&lt;strong&gt;&lt;a href=&quot;#clip&quot;&gt;Clipping&lt;/a&gt;&lt;/strong&gt;? - &lt;strong&gt;&lt;a href=&quot;#types&quot;&gt;Types of Clipping&lt;/a&gt; in Computer Graphics&lt;/strong&gt; &lt;strong&gt;(&lt;a href=&quot;https://www.allbca.com/2020/03/Computer-Graphics-Multimedia-Application-CGMA.html&quot; target=&quot;_blank&quot;&gt;Computer graphics and multimedia application All Notes&lt;/a&gt;)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;
&lt;hr /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhx_jIuo-db33Vql1oGs8OmB6FwYTGyiVSv8etSzco0SOMoclvfxNegBJp0x6awxmIK9WOaU-Xu-RHZOSR2gE88gH9K7n1J_NNKcKQJnjTYiIhpeVOs8ykJ53I7MOOrcmOkgq1IivOEgg/s1600/clipping-types-in-computer-graphics-www.allbca.com.webp&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;clipping-types-in-computer-graphics-www.allbca.com&quot; border=&quot;0&quot; data-original-height=&quot;600&quot; data-original-width=&quot;800&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhx_jIuo-db33Vql1oGs8OmB6FwYTGyiVSv8etSzco0SOMoclvfxNegBJp0x6awxmIK9WOaU-Xu-RHZOSR2gE88gH9K7n1J_NNKcKQJnjTYiIhpeVOs8ykJ53I7MOOrcmOkgq1IivOEgg/s640/clipping-types-in-computer-graphics-www.allbca.com.webp&quot; title=&quot;clipping-types-in-computer-graphics-www.allbca.com&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2 id=&quot;clip&quot;&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Q1. What do you mean by Clipping? Various Types of Clipping?&lt;/span&gt;&lt;span style=&quot;color: #999999;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #f3f3f3;&quot;&gt;Types of Clipping in Computer Graphics&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans. Clipping:&lt;/strong&gt; Any procedure that identifies those portions of a picture that are either inside or outside of a specified region of space is referred to as a clipping algorithm or simply clipping. The region against which an object is to be clipped is called a clip window. Clipping is the process to identify the picture either inside or outside of the displaying area.&lt;br /&gt;
&lt;br /&gt;
Application of clipping includes extracting part of a defined scene for viewing, identifying visible surface in three-dimensional views, object boundary, creating objects using solid modelling procedures, displaying a multi-window environment and drawing and painting operations, moving, cursing depending on the application, the clip window can be general polygon or it can have curved boundaries.&lt;br /&gt;
&lt;br /&gt;
For the viewing transformation, we want to display only those picture parts that are within the window area. Everything outside the window is discarded. Clipping algorithm can be applied in world co-ordinates, so that only the contents of the window interior are mapped to device co-ordinates.&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
  &lt;hr /&gt;
&lt;h3 id=&quot;types&quot;&gt;
&lt;span style=&quot;color: red;&quot;&gt;Types of Clipping : &lt;/span&gt;&lt;/h3&gt;
  These are the main types of clipping&lt;br /&gt;&lt;br /&gt;
&lt;strong&gt;1.&lt;/strong&gt; Point clipping.&lt;br /&gt;
&lt;strong&gt;2.&lt;/strong&gt; Line clipping (straight line segment).&lt;br /&gt;
&lt;strong&gt;3.&lt;/strong&gt; Area clipping (polygons) or curve clipping.&lt;br /&gt;
&lt;strong&gt;4.&lt;/strong&gt; Text clipping.&lt;br /&gt;
&lt;br /&gt;
Line and polygon clipping routines are standard components of the graphics package, but many packages accommodate curved objects.&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: red;&quot;&gt;1. Point Clipping:&lt;/span&gt;&lt;/strong&gt; Assuming that the clip window is a rectangle in the standard position we have a point P = (x, y) for display, if the following conditions are satisfied :&lt;br /&gt;
&lt;br /&gt;
Xw min ≤ x ≤ Xw max&amp;nbsp; ,&amp;nbsp; Yw min ≤ y ≤ Yw max.&lt;br /&gt;
&lt;br /&gt;
Where the edges of the clip window (Xw min , Xw max, Yw min, Yw max ) can be either the world co-ordinate window boundaries or viewport boundaries. If anyone of these four conditions is not satisfied the point is clipped.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjd6mdLE4qU8bhzv1k3l8JQvODQujhU7YZhfeXYwMEtJm4yRDjA1q30U0qTXB_hh9cn_BFikTFsUceBexrj3_QQXc77l0X-qCEEleiEh1e3UzSYVPougUxqQLZVoiIAv2bSnio77DYqSQ/s1600/Point-Clipping-in-computer-graphics-www.allbca.com.webp&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Point-Clipping-in-computer-graphics-www.allbca.com&quot; border=&quot;0&quot; data-original-height=&quot;600&quot; data-original-width=&quot;850&quot; height=&quot;450&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjd6mdLE4qU8bhzv1k3l8JQvODQujhU7YZhfeXYwMEtJm4yRDjA1q30U0qTXB_hh9cn_BFikTFsUceBexrj3_QQXc77l0X-qCEEleiEh1e3UzSYVPougUxqQLZVoiIAv2bSnio77DYqSQ/s640/Point-Clipping-in-computer-graphics-www.allbca.com.webp&quot; title=&quot;Point-Clipping-in-computer-graphics-www.allbca.com&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;strong&gt;For Example:&lt;/strong&gt; Point clipping can be applied to the scene involving explosions that are modelled with particles (points) distributed in some region of the scene.&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: red;&quot;&gt;2. Line Clipping:&lt;/span&gt;&lt;/strong&gt; A line clipping procedure involves several parts. First, we can test a given line segment to determine whether it lies completely inside the clipping window if it does not, we try to determine whether it lies completely outside the window.&lt;br /&gt;
&lt;br /&gt;
Finally, if we cannot identify a line segment as completely inside or completely outside we must perform intersection calculations with one or more clipping boundaries.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0pKAXXPbLIT2fF4ybYAZJmhQPFMqZOdVF_wbnwSCHRPxcCXOq7NBC6vDCDh3shpxgk2Ap-_r0NLQXbLKLZVSXlCfWFeOe2rL0iDBCwrew9BikzrYVYZjG0AxTnRmKwRViLgT8jLPdYA/s1600/Line-Clipping-in-computer-graphics-www.allbca.com.webp&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Line-Clipping-in-computer-graphics-www.allbca.com&quot; border=&quot;0&quot; data-original-height=&quot;596&quot; data-original-width=&quot;1600&quot; height=&quot;238&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0pKAXXPbLIT2fF4ybYAZJmhQPFMqZOdVF_wbnwSCHRPxcCXOq7NBC6vDCDh3shpxgk2Ap-_r0NLQXbLKLZVSXlCfWFeOe2rL0iDBCwrew9BikzrYVYZjG0AxTnRmKwRViLgT8jLPdYA/s640/Line-Clipping-in-computer-graphics-www.allbca.com.webp&quot; title=&quot;Line-Clipping-in-computer-graphics-www.allbca.com&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
A line with both endpoints insides all clipping boundaries, such as the line P1 to P2 is saved. A line with both endpoints outside any one of the clip boundaries (line P3 P4) is outside the window.&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: red;&quot;&gt;3. Area Clipping (Polygons) or Curve Clipping:&lt;/span&gt;&lt;/strong&gt; Area with curved boundaries can be clipped with methods similar to point clipping and line clipping. Curve clipping procedures will involve non-linear equations and this requires more processing than for object with linear boundaries.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgD6Sn0__GEL7e83ukztYX7SZZ1r8oAwo1bF9-I5WGfd6UAArsz2yvXFbH22JLwKPJmji5HGi6S9q1s1CsVdGSuRunMHeVkJ0E1jApa5A0YmKsA-3EL7Qxk0KZxhimCVoIKh5o2Y6A3rQ/s1600/Area-or-Curve-Clipping-in-computer-graphics-www.allbca.com.webp&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Area-or-Curve-Clipping-in-computer-graphics-www.allbca.com&quot; border=&quot;0&quot; data-original-height=&quot;975&quot; data-original-width=&quot;1600&quot; height=&quot;390&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgD6Sn0__GEL7e83ukztYX7SZZ1r8oAwo1bF9-I5WGfd6UAArsz2yvXFbH22JLwKPJmji5HGi6S9q1s1CsVdGSuRunMHeVkJ0E1jApa5A0YmKsA-3EL7Qxk0KZxhimCVoIKh5o2Y6A3rQ/s640/Area-or-Curve-Clipping-in-computer-graphics-www.allbca.com.webp&quot; title=&quot;Area-or-Curve-Clipping-in-computer-graphics-www.allbca.com&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
The bounding rectangle for a circle or other curved object can be used first to test the overlap with a rectangular clip window. If the bounding rectangle for the object completely inside the window, we save the object. If the rectangle is determined to be completely outside the window, we discard the object.&lt;br /&gt;
&lt;br /&gt;
If the bounding rectangle test fail, we can look for other computation saving approaches. For a circle, we can use co-ordinate extent of individual quadrants and then octants for testing before calculating curve window intersections.&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: red;&quot;&gt;4. Text Clipping:&lt;/span&gt;&lt;/strong&gt; There are several techniques that can be used to provide text clipping in a graphics package. The clipping technique used will depends on method used to generate characters and the requirements of a particular application.&lt;br /&gt;
&lt;br /&gt;
The simplest method for processing character string relative to a window boundary is to use them all or one string clipping strategy. If all of the string is inside a clip window, we keep it. Otherwise, the string is discarded. This procedure is implemented by considering a bounding rectangle around the text pattern.&lt;br /&gt;
&lt;br /&gt;
The boundary position of the rectangle are then compared to window boundaries and the string is rejected if there is any overlap.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfSeF3SPVP50PbmjxEYJFpDjgcm8m811x0f-l3OfE12b2IBTowCWqrLDGfbleLBl8iUo9uhhcOmR_1ZELPTN9lxCL5JNApTfSG8FAQU8kQeehBJnwfJslvdFuM7sY2s-MTExhZqQAyWA/s1600/Text-Clipping-in-computer-graphics-www.allbca.com.webp&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Text-Clipping-in-computer-graphics-www.allbca.com&quot; border=&quot;0&quot; data-original-height=&quot;737&quot; data-original-width=&quot;1600&quot; height=&quot;294&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfSeF3SPVP50PbmjxEYJFpDjgcm8m811x0f-l3OfE12b2IBTowCWqrLDGfbleLBl8iUo9uhhcOmR_1ZELPTN9lxCL5JNApTfSG8FAQU8kQeehBJnwfJslvdFuM7sY2s-MTExhZqQAyWA/s640/Text-Clipping-in-computer-graphics-www.allbca.com.webp&quot; title=&quot;Text-Clipping-in-computer-graphics-www.allbca.com&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
An alternative to reject an entire character string that overlaps a window boundary is to use them all or none character clipping strategy. Here we discard only those characters that are not completely inside the window.&lt;br /&gt;
&lt;br /&gt;
A final method for handling text clipping is to clip the components of individual characters. We now treat the character in the same way as the line.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;span style=&quot;color: #f3f3f3;&quot;&gt;[ Topic= Types of Clipping in Computer Graphics ]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;
  &lt;br /&gt;&lt;br /&gt;
&lt;hr /&gt;&lt;b&gt;Next Topic :&amp;nbsp;&lt;a href=&quot;https://www.allbca.com/2020/04/polygon-clipping-sutherland-hodgeman-algorithm.html&quot; target=&quot;_blank&quot;&gt;Polygon and Polygon Clipping | Sutherland Hodgeman Algorithm&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
  We are providing you the &lt;b&gt;10 Best Topics of Computer Graphics&lt;/b&gt; as below:&lt;br /&gt;&lt;br /&gt;
  1. &lt;a href=&quot;https://www.allbca.com/2020/04/multimedia-tools-and-applications.html&quot; target=&quot;_blank&quot;&gt;Multimedia - Tools and Applications, Skills, Uses, Stages,Types&lt;/a&gt;&lt;br /&gt;
  2. &lt;a href=&quot;https://www.allbca.com/2020/04/computer-animation.html&quot; target=&quot;_blank&quot;&gt;Computer Animation - Types, Methods, Applications, Softwares&lt;/a&gt;&lt;br /&gt;
  3. &lt;a href=&quot;https://www.allbca.com/2020/04/bezier-curve-in-computer-graphics.html&quot; target=&quot;_blank&quot;&gt;Bezier Curve and its Characteristics&lt;/a&gt;&lt;br /&gt;
  4. &lt;a href=&quot;https://www.allbca.com/2020/04/projection-in-computer-graphics.html&quot; target=&quot;_blank&quot;&gt;What is Projection ? Parallel and Perspective&lt;/a&gt;&lt;br /&gt;
  5. &lt;a href=&quot;https://www.allbca.com/2020/04/computer-graphics-bresenhams-line-algorithm.html&quot; target=&quot;_blank&quot;&gt;Bresenham&#39;s Line Algorithm and its advantages, disadvantages&lt;/a&gt;&lt;br /&gt;
  6. &lt;a href=&quot;https://www.allbca.com/2020/04/2d-transformation-in-computer-graphics.html&quot; target=&quot;_blank&quot;&gt;What is Transformation and 2D Transformation&lt;/a&gt;&lt;br /&gt;
  7. &lt;a href=&quot;https://www.allbca.com/2020/04/computer-graphics-dda-algorithm.html&quot; target=&quot;_blank&quot;&gt;DDA Algorithm and DDA Line Drawing Algorithm&lt;/a&gt;&lt;br /&gt;
  8. &lt;a href=&quot;https://www.allbca.com/2020/04/b-spline-curve-in-computer-graphics.html&quot; target=&quot;_blank&quot;&gt;B Spline Curve and its continuity conditions&lt;/a&gt;&lt;br /&gt;
  9. &lt;a href=&quot;https://www.allbca.com/2020/04/hard-copy-devices-in-computer-graphics.html&quot; target=&quot;_blank&quot;&gt;Hard Copy Devices and its Technologies&lt;/a&gt;&lt;br /&gt;
  10. Computer Graphics and its Applications&lt;br /&gt;&lt;br /&gt;&lt;b&gt;
  You may also like: &lt;a href=&quot;https://www.allbca.com/2020/04/bca-bachelor-of-computer-applications-course-details.html&quot; target=&quot;_blank&quot;&gt;BCA Course Details - Subjects, Fees, Duration, Salary etc.&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #f3f3f3;&quot;&gt;[ Topic= Types of Clipping in Computer Graphics ]&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;hr /&gt;
&lt;strong&gt;Join us on Facebook, Instagram, and Twitter to get the latest study material. You can also ask us any questions.&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;Facebook =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;a href=&quot;https://www.fb.com/allbcaweb&quot; rel=&quot;nofollow&quot; style=&quot;color: blue;&quot; target=&quot;_blank&quot;&gt;@allbcaweb&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Facebook)&lt;br /&gt;
&lt;b&gt;Instagram&lt;/b&gt; = &lt;a href=&quot;https://www.instagram.com/allbcaweb/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;@allbcaweb&lt;/b&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Instagram)&lt;br /&gt;
&lt;strong&gt;Twitter =&amp;nbsp;&lt;span style=&quot;color: #00ccff;&quot;&gt;&lt;a href=&quot;https://www.twitter.com/allbcaweb&quot; rel=&quot;nofollow&quot; style=&quot;color: #00ccff;&quot; target=&quot;_blank&quot;&gt;@allbcaweb&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Twitter)&lt;br /&gt;
&lt;b&gt;Email=&amp;nbsp;&lt;a href=&quot;mailto:allbca.com@gmail.com&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;allbca.com@gmail.com&lt;/a&gt;&lt;br /&gt;Send us your query anytime about Types of Clipping in Computer Graphics!&lt;/b&gt;&lt;br /&gt;&lt;hr /&gt;
&lt;span style=&quot;color: #f3f3f3;&quot;&gt;[ Topic= Types of Clipping in Computer Graphics ]&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: #993366;&quot;&gt;External Link:-&lt;/span&gt;&lt;/h3&gt;
1. Types of Clipping in Computer Graphics - (&lt;a href=&quot;https://en.wikipedia.org/wiki/Clipping_(computer_graphics)&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
2. Types of Clipping in Computer Graphics - (&lt;a href=&quot;https://www.slideshare.net/udayanrisingsun/clipping-8794672&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #f3f3f3;&quot;&gt;[ Topic= Types of Clipping in Computer Graphics ]&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;[ Topic= Types of Clipping in Computer Graphics ]&lt;/b&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/4501385978427008826'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/4501385978427008826'/><link rel='alternate' type='text/html' href='https://www.allbca.com/2020/04/clipping-types-in-computer-graphics.html' title='Clipping - Types of Clipping in Computer Graphics'/><author><name>Mayank Rana</name><uri>http://www.blogger.com/profile/06163424302596650438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs9mOMQbRjoNrVnY7AbBycXEpeOG7szPXA2y_RbbeTVJ25GEGpq6q-gZxcoKqROoy4G51CI9ZCvXhjBXCUH8gb-MvrIfJnbBBdt4BY6sgH3zI2blMucgSoV-XQYw6d9g/s125/mayankrana.webp'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhx_jIuo-db33Vql1oGs8OmB6FwYTGyiVSv8etSzco0SOMoclvfxNegBJp0x6awxmIK9WOaU-Xu-RHZOSR2gE88gH9K7n1J_NNKcKQJnjTYiIhpeVOs8ykJ53I7MOOrcmOkgq1IivOEgg/s72-c/clipping-types-in-computer-graphics-www.allbca.com.webp" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5313576602653501716.post-2687425187948531564</id><published>2021-05-18T19:29:00.003+05:30</published><updated>2021-05-18T19:50:20.699+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Amazing-Facts"/><title type='text'>50 Amazing Facts in Hindi | आश्चर्यजनक और रोचक तथ्य हिंदी में</title><content type='html'> &lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;noscript&gt;&lt;img style=&quot;display:none&quot; data-original-height=&quot;270&quot; data-original-width=&quot;400&quot; height=&quot;216&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaG4qyu6inZGX0DFV20uOIaupj-HBmSkPr26kMsPDaee_JtBFEo2j_Pc2zLbxXowsl6O45oC1zt1nNLvlv8L3PjYC1srorR_oexoQO5YIMAEjLDv5Mch_HDo3zabIXzUHj6m2mp_ZnIg/s1600/50-Amazing-Facts-in-Hindi-by-Studywow1234.jpg&quot; width=&quot;320&quot; /&gt;&lt;/noscript&gt;&lt;/div&gt;&lt;strong&gt;AllBCA:&lt;/strong&gt; read 50 most &lt;strong&gt;Amazing Facts in Hindi&lt;/strong&gt; only on AllBCA. &lt;strong&gt;Amazing Facts in Hindi&lt;/strong&gt; about life, about science, about india and about world. ऐसे ही 20 और मजेदार फैक्ट्स पढ़ने के लिए यहाँ &lt;strong&gt;&lt;a href=&quot;https://www.allbca.com/2020/04/amazing-facts-on-technology-in-hindi.html&quot; target=&quot;_blank&quot;&gt;क्लिक करे&lt;/a&gt;&lt;/strong&gt;|&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;img alt=&quot;50-Amazing-Facts-in-Hindi-by-AllBCA&quot; data-original-height=&quot;1079&quot; data-original-width=&quot;1600&quot; height=&quot;268&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPIFSkGHPLznozIagdmoCqMuBrn2Y3b3rIeBQ-zfEQLopCK0-eY940VTT9dhAYki6ugEfiOiC3vyb7DCJ2ZbGbtBkyFaSiTTMaNz1ataOtS_Ky_S8nCSqUEvzWECF0SiqjiZ-N9KOp-Q/s1600/50-Amazing-Facts-in-Hindi-by-Studywow.jpg&quot; title=&quot;50-Amazing-Facts-in-Hindi-by-AllBCA&quot; width=&quot;400&quot;&gt;&lt;/div&gt;&lt;br /&gt;&lt;h2 class=&quot;css-63oe3q&quot;&gt;50 Amazing Facts in Hindi | आश्चर्यजनक और रोचक तथ्य हिंदी में&lt;/h2&gt;1. सूर्य की कोर से सतह तक यात्रा करने के लिए एक फोटॉन 200,000 साल का समय लगता है, फिर सूर्य की सतह से आपके eyeball से केवल 8 मिनट की दूरी पर।&lt;br /&gt;&lt;br /&gt;2. एक TI-83 कैलकुलेटर में कंप्यूटर की तुलना में छह गुना अधिक प्रसंस्करण शक्ति है जो चंद्रमा पर अपोलो 11 उतरा।&lt;br /&gt;&lt;br /&gt;2. मनोविज्ञान वह मस्तिष्क है जो स्वयं को समझने की कोशिश कर रहा है।&lt;br /&gt;&lt;br /&gt;3. ध्वनि, दृष्टि, स्पर्श, गंध और स्वाद की पांच पारंपरिक इंद्रियों के साथ-साथ, मनुष्यों में 15 &quot;अन्य इंद्रियां हैं।&quot; इनमें संतुलन, तापमान, दर्द और समय के साथ-साथ घुटन, प्यास और पूर्णता के लिए आंतरिक इंद्रियां शामिल हैं।&lt;br /&gt;&lt;br /&gt;4. मनुष्य ने अपने जीवनकाल में 40 पाउंड त्वचा को बहाया, हर महीने अपनी बाहरी त्वचा को पूरी तरह से बदल दिया।&lt;br /&gt;&lt;br /&gt;5. औसत वयस्क मानव के शरीर में दो से नौ पाउंड बैक्टीरिया होते हैं।&lt;br /&gt;&lt;br /&gt;6. दाएं हाथ के लोगों के लिए उपयोग किए जाने वाले उपकरणों के उपयोग से हर साल 2,500 से अधिक बाएं हाथ के लोग मारे जाते हैं।&lt;br /&gt;&lt;br /&gt;7. स्टारफिश अपने हथियारों को फिर से विकसित कर सकते हैं। वास्तव में, एक एकल हाथ पूरे शरीर को पुन: उत्पन्न कर सकता है।&lt;br /&gt;&lt;br /&gt;8. Google के संस्थापक 1999 में $ 1 मिलियन से अधिक के लिए एक्साइट को बेचने के इच्छुक थे - लेकिन एक्साइट ने उन्हें ठुकरा दिया।&lt;br /&gt;&lt;br /&gt;9. पृथ्वी पर सभी चींटियों का कुल वजन ग्रह पर सभी मनुष्यों के कुल वजन से अधिक है।&lt;br /&gt;&lt;br /&gt;10. फेसबुक इंजीनियर मूल रूप से &quot;लाइक&quot; बटन को &quot;Awesome&quot; बटन कहना चाहते थे।&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Amazing Facts in Hindi about World&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;11. 2008 के एक सर्वेक्षण में, 58% ब्रिटिश किशोरों ने सोचा कि शर्लक होम्स एक असली लड़का है, जबकि 20% ने सोचा कि विंस्टन चर्चिल नहीं थे।&lt;br /&gt;&lt;br /&gt;12. 160 साल पहले आलू के अकाल से पहले आयरलैंड की आबादी अब भी 2 मिलियन कम है।&lt;br /&gt;&lt;br /&gt;13. सुप्रीम कोर्ट के ऊपर एक बास्केटबॉल कोर्ट है। इसे भूमि के सबसे ऊंचे न्यायालय के रूप में जाना जाता है।&lt;br /&gt;&lt;br /&gt;14. यदि मानव मस्तिष्क एक कंप्यूटर होता, तो वह प्रति सेकंड 38 हजार-ट्रिलियन ऑपरेशन कर सकता था। दुनिया का सबसे शक्तिशाली सुपर कंप्यूटर, BlueGene, केवल .002% का प्रबंधन कर सकता है।&lt;br /&gt;&lt;br /&gt;15. Seahorses&amp;nbsp;एक-दूसरे की पूंछ पकड़े हुए एकांगी जीवन साथी हैं और जोड़े में यात्रा करते हैं।&lt;br /&gt;&lt;br /&gt;16. संवैधानिक सम्मेलन में भाग लेने वाले प्रतिनिधियों ने अपना अधिकांश समय नशे में व्यतीत किया। एक जीवित दस्तावेज संविधान के हस्ताक्षर से दो दिन पहले 15 सितंबर, 1787 को एक पार्टी के लिए एक बिल है। बिल पर आइटम थे: मदीरा की 54 बोतलें, क्लेरे की 60 बोतलें, व्हिस्की की 8 बोतलें, साइडर की 8 बोतलें, बीयर की 12 बोतलें और एल्कोहल पंच के 7 कटोरे। 55 लोगों के लिए यह सब।&lt;br /&gt;&lt;br /&gt;17. &quot;मछली की बारिश&quot; एक वार्षिक मौसम की घटना है जिसमें योरो के होंडुरन शहर में आकाश से सैकड़ों मछलियों की बारिश होती है।&lt;br /&gt;&lt;br /&gt;18. एक मच्छर के 47 दांत होते हैं।&lt;br /&gt;&lt;br /&gt;19. संयुक्त राज्य अमेरिका जर्मनी की तुलना में एक पुराना देश है।&lt;br /&gt;&lt;br /&gt;20. मानव उंगलियां इतनी संवेदनशील हैं कि यदि आपकी उंगलियां पृथ्वी के आकार की हैं, तो आप एक घर और कार के बीच अंतर महसूस कर सकते हैं।&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Amazing Facts in Hindi about Life&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;21. जुड़वा बच्चों के जन्म के बीच सबसे लंबा अंतराल 87 दिनों का है।&lt;br /&gt;&lt;br /&gt;22. दुनिया में वर्तमान में अधिक लोग भूख से मोटापे से पीड़ित हैं।&lt;br /&gt;&lt;br /&gt;23. एक चूहा एक बॉलपॉइंट पेन के आकार के छेद के माध्यम से फिट हो सकता है।&lt;br /&gt;&lt;br /&gt;24. Pac-Man&amp;nbsp;पर काम करते समय, वीडियो गेम डिज़ाइनर Tohru Iwantani को कथित तौर पर एक स्लाइस के साथ पिज़्ज़ा के आकार से प्रेरित किया गया था।&lt;br /&gt;&lt;br /&gt;25. औसत हमिंगबर्ड की हृदय गति 1,200 बीट प्रति मिनट से अधिक है।&lt;br /&gt;&lt;br /&gt;26. 1518 का डांसिंग प्लेग जर्मनी में हुआ डांसिंग मेनिया का मामला था, जहाँ लोग एक महीने तक आराम किए बिना सीधे नाचते थे।&lt;br /&gt;&lt;br /&gt;27. 30 मिनट में, मानव शरीर एक गैलन पानी उबालने के लिए पर्याप्तः गर्मी देता है।&lt;br /&gt;&lt;br /&gt;28. एक वयस्क 7,000,000,000,000,000,000,000,000,000 (7 ओकटिलियन) परमाणुओं से बना होता है। परिप्रेक्ष्य में, हमारी आकाशगंगा में एक &#39;औसत दर्जे का&#39; 300,000,000,000 (300 बिलियन) सितारे हैं।&lt;br /&gt;&lt;br /&gt;29. हवाई जहाज का खाना बहुत स्वादिष्ट नहीं होता है क्योंकि हमारी गंध और स्वाद की भावना उड़ानों के दौरान 20 से 50 प्रतिशत तक कम हो जाती है।&lt;br /&gt;&lt;br /&gt;30. एक ब्लू व्हेल का दिल एक वीडब्ल्यू बीटल का आकार है और काफी बड़ा है कि आप इसे धमनियों के माध्यम से तैर सकते हैं।&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Amazing Facts in Hindi about Body&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;31. बकरियों में आयताकार पुतलियाँ होती हैं।&lt;br /&gt;&lt;br /&gt;32. अफ्रीका का दो-तिहाई भाग उत्तरी गोलार्ध में है।&lt;br /&gt;&lt;br /&gt;33. डॉल्फ़िन के एक-दूसरे के नाम होते है और विशेष रूप से एक-दूसरे को बुला सकते है।&lt;br /&gt;&lt;br /&gt;34. बृहस्पति और शनि में हीरे की बारिश होती है।&lt;br /&gt;&lt;br /&gt;35. क्लियोपेट्रा, महान पिरामिड की इमारत की तुलना में पहले चंद्रमा लैंडिंग के समय के करीब रहता था।&lt;br /&gt;&lt;br /&gt;36. पृथ्वी के सभी महासागरों में पानी के गिलास की तुलना में एक गिलास पानी में अधिक परमाणु होते हैं।&lt;br /&gt;&lt;br /&gt;37. इससे पहले कि नाजियों ने पेरिस पर हमला किया, एच.ए. और मारग्रेट रे साइकिल पर भाग गए। वे Curious George की manuscript ले जा रहे थे।&lt;br /&gt;&lt;br /&gt;38. Cotton कैंडी का आविष्कार एक दंत चिकित्सक द्वारा किया गया था।&lt;br /&gt;&lt;br /&gt;39. लॉस एंजिल्स में दूसरे देशों के लोगो की तुलना में अधिक कारें हैं।&lt;br /&gt;&lt;br /&gt;40. बबल रैप मूल रूप से वॉलपेपर के रूप में इस्तेमाल करने के लिए डिज़ाइन किया गया था।&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Amazing Facts in Hindi about Nature&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;41. आप हर सात साल में अपने शरीर के प्रत्येक कण को ​​प्रतिस्थापित करते हैं। आप सचमुच वही व्यक्ति नहीं हैं जो आप 7 साल पहले थे।&lt;br /&gt;&lt;br /&gt;42. क्लियोपेट्रा द्वारा एक बार पीने पर पानी के किसी भी गिलास में कम से कम 1 अणु पाए जाने की संभावना व्यावहारिक रूप से 100% है।&lt;br /&gt;&lt;br /&gt;43. Nutella का आविष्कार WWII के दौरान किया गया था, जब एक इतालवी पेस्ट्री निर्माता ने अपने चॉकलेट राशन का विस्तार करने के लिए चॉकलेट में हेज़लनट्स मिलाया।&lt;br /&gt;&lt;br /&gt;44. दुनिया के इतिहास में खनन किया गया सभी सोना 20x20x20 मीटर क्यूब में फिट हो सकता है।&lt;br /&gt;&lt;br /&gt;45. नेप्च्यून गृह एक ऐसा पहला गृह जो गणिताजायो के द्वारा, दूरबीन से खोजे जाने से पहले ही खोज निकला था&lt;br /&gt;&lt;br /&gt;46. दुनिया का सबसे लंबा musical piece 639 साल तक रहता है।&lt;br /&gt;&lt;br /&gt;47. दुनिया की 90% आबादी उत्तरी गोलार्ध में रहती है।&lt;br /&gt;&lt;br /&gt;48. कुत्ते लोकप्रिय जानवर हैं जो महान पारिवारिक पालतू जानवरों के साथ-साथ विश्वसनीय श्रमिक भी होते है ।&lt;br /&gt;&lt;br /&gt;49. मैग्मा पृथ्वी की सतह के नीचे गर्म तरल चट्टान है, इसे ज्वालामुखी से निकलने के बाद लावा के रूप में जाना जाता है।&lt;br /&gt;&lt;br /&gt;50. हमें बिल्कुल यकीन नहीं है कि मिल्की वे में कितने सितारे हैं| कोई नहीं जानता कि मिल्की वे का वजन कितना है| Astronomers &amp;nbsp;मिल्की वे के केंद्र में Monster ब्लैक होल की तस्वीर लेने की कोशिश कर रहे हैं|&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Amazing Facts in Hindi&lt;/strong&gt;&lt;br /&gt;Read more 10 &lt;strong&gt;Amazing Facts in Hindi&lt;/strong&gt; to just &lt;strong&gt;&lt;a href=&quot;https://www.allbca.com/search/label/Amazing-Facts&quot;&gt;click here&lt;/a&gt;&lt;/strong&gt;.&lt;br /&gt;&lt;strong&gt;ऐसे ही Science से सम्बंधित मजेदार फैक्ट्स&lt;/strong&gt; पढ़ने के लिए यहाँ&lt;strong&gt; &lt;a href=&quot;https://www.allbca.com/2020/04/amazing-facts-about-science-in-hindi.html&quot;&gt;क्लिक करे&lt;/a&gt;|&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Join us on Facebook and Twitter to get the latest Amazing Facts in Hindi.&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;a href=&quot;https://www.fb.com/allbcaweb&quot; rel=&quot;nofollow&quot;&gt;Facebook&lt;/a&gt;&amp;nbsp;= @ allbcaweb&lt;/strong&gt;&lt;br /&gt;(click on it or search &quot;allbcaweb&quot; on facebook)&lt;br /&gt;&lt;strong&gt;&lt;a href=&quot;https://www.twitter.com/allbcaweb&quot; rel=&quot;nofollow&quot;&gt;Twitter&lt;/a&gt;&amp;nbsp;= @ allbcaweb&lt;/strong&gt;&lt;br /&gt;(click on it or search &quot;allbcaweb&quot; on Twitter)&lt;br /&gt;&lt;b&gt;Email=&amp;nbsp;&lt;a href=&quot;mailto:allbca.com@gmail.com&quot;&gt;allbca.com@gmail.com&lt;/a&gt;&lt;br /&gt;Send us your query anytime!&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;50 &lt;strong&gt;Amazing Facts in Hindi&lt;/strong&gt; | आश्चर्यजनक और रोचक तथ्य हिंदी में &lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/2687425187948531564'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/2687425187948531564'/><link rel='alternate' type='text/html' href='https://www.allbca.com/2020/01/50-amazing-facts-in-hindi.html' title='50 Amazing Facts in Hindi | आश्चर्यजनक और रोचक तथ्य हिंदी में'/><author><name>Mayank Rana</name><uri>http://www.blogger.com/profile/06163424302596650438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs9mOMQbRjoNrVnY7AbBycXEpeOG7szPXA2y_RbbeTVJ25GEGpq6q-gZxcoKqROoy4G51CI9ZCvXhjBXCUH8gb-MvrIfJnbBBdt4BY6sgH3zI2blMucgSoV-XQYw6d9g/s125/mayankrana.webp'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaG4qyu6inZGX0DFV20uOIaupj-HBmSkPr26kMsPDaee_JtBFEo2j_Pc2zLbxXowsl6O45oC1zt1nNLvlv8L3PjYC1srorR_oexoQO5YIMAEjLDv5Mch_HDo3zabIXzUHj6m2mp_ZnIg/s72-c/50-Amazing-Facts-in-Hindi-by-Studywow1234.jpg" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5313576602653501716.post-629093000153466835</id><published>2020-05-09T03:24:00.001+05:30</published><updated>2020-05-17T18:15:01.895+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="BCA-Sem-5th"/><title type='text'>Logical &amp; Physical Address Space | Resource Allocation Graph</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;Intro&lt;/b&gt;: Q1.&lt;strong&gt;Difference between Logical and Physical Address Space&lt;/strong&gt;? Q2.&lt;strong&gt;Explain Resource Allocation Graph with the help of an example&lt;/strong&gt;? &lt;strong&gt;(&lt;a href=&quot;https://www.allbca.com/2020/03/Operating-System-Notes-BCA.html&quot;&gt;Operating System all notes&lt;/a&gt;)&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj78DfF9p8hutK6sGMX9vzxZtEQh3ZHvEUAWdxLIGhZuzC7VwVoeSANnn0zPAOCsogYzljrgGv9HUW4iqn3ipffYYMwOhf61MyyXmw3GjU6uyY9BOtEE2G90RjcUV5nBVn0Zi4RQOfo_A/s1600/Logical-and-Physical-Address-Space-in-Operating-System.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Logical-and-Physical-Address-Space-in-Operating-System&quot; border=&quot;0&quot; data-original-height=&quot;600&quot; data-original-width=&quot;800&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj78DfF9p8hutK6sGMX9vzxZtEQh3ZHvEUAWdxLIGhZuzC7VwVoeSANnn0zPAOCsogYzljrgGv9HUW4iqn3ipffYYMwOhf61MyyXmw3GjU6uyY9BOtEE2G90RjcUV5nBVn0Zi4RQOfo_A/s640/Logical-and-Physical-Address-Space-in-Operating-System.webp&quot; title=&quot;Logical-and-Physical-Address-Space-in-Operating-System&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q1. Difference between Logical and Physical Address Space?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans. Difference between Logical and Physical Address Space:&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;The logical address&lt;/strong&gt; is one that is generated by CPU also referred to as a virtual machine address. &lt;strong&gt;The physical address&lt;/strong&gt; is the actual address understood by computer hardware, memory unit. During logical to physical address translation care is taken by the operating system.&lt;br /&gt;
&lt;br /&gt;
The term &lt;strong&gt;virtual memory&lt;/strong&gt; refers to the abstraction of separating logical memory. Because of this separation, the programmer needs to be aware of only the logical memory space while the operating system maintains two or more levels of physical memory space.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiM6Yf7ZdzzIu2MC5JAAb0DindAo8iGq2a16VWYfm-Z7YDt6DDpSyn5sfxMok3DzpykMZIAysKu9EPvgvOUbqzb_pBWpf3YNw4O4WnmQz5guYVRntnnTP12dBV6L3Lc0Cfo8JwHI2NZg/s1600/Diagram-of-Logical-and-Physical-Address-Space-example.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Diagram-of-Logical-and-Physical-Address-Space-example&quot; border=&quot;0&quot; data-original-height=&quot;329&quot; data-original-width=&quot;1600&quot; height=&quot;130&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiM6Yf7ZdzzIu2MC5JAAb0DindAo8iGq2a16VWYfm-Z7YDt6DDpSyn5sfxMok3DzpykMZIAysKu9EPvgvOUbqzb_pBWpf3YNw4O4WnmQz5guYVRntnnTP12dBV6L3Lc0Cfo8JwHI2NZg/s640/Diagram-of-Logical-and-Physical-Address-Space-example.webp&quot; title=&quot;Diagram-of-Logical-and-Physical-Address-Space-example&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
The Memory Management Unit (MMU) handles translations of these addresses. MMU is a hardware device that maps logical addresses to the physical address. It maps the virtual address to the real store location. The simple MMU scheme adds the relocation register contents to the base address of the program that is generated at the time it is sent to memory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiI-Bt8HFCFYPiMyL3nTWuI1TufDJ_YXMTZvxjct5hqAQ2wCli6C7RO51KbNNlse7MsYXfcq4GYtlsIcNNdS0X0mgOaTQB47-pGDVC1jaKU3ulLX5QE3S-q3vqdl0nsuIEYBK4JBej-8A/s1600/Resource-Allocation-Graph-in-Operating-System.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Resource-Allocation-Graph-in-Operating-System&quot; border=&quot;0&quot; data-original-height=&quot;600&quot; data-original-width=&quot;800&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiI-Bt8HFCFYPiMyL3nTWuI1TufDJ_YXMTZvxjct5hqAQ2wCli6C7RO51KbNNlse7MsYXfcq4GYtlsIcNNdS0X0mgOaTQB47-pGDVC1jaKU3ulLX5QE3S-q3vqdl0nsuIEYBK4JBej-8A/s640/Resource-Allocation-Graph-in-Operating-System.webp&quot; title=&quot;Resource-Allocation-Graph-in-Operating-System&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q2. Explain Resource Allocation Graph with the help of an example?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans. Resource Allocation Graph (RAG)&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;(a)&lt;/strong&gt; Deadlock can be described through a resource allocation graph.&lt;br /&gt;
&lt;strong&gt;(b)&lt;/strong&gt; The RAG consists of a set of vertices P ={P&lt;sub&gt;1&lt;/sub&gt;, P&lt;sub&gt;2&lt;/sub&gt;,...,P&lt;sub&gt;n&lt;/sub&gt;} of processes and R = {R&lt;sub&gt;1&lt;/sub&gt;,R&lt;sub&gt;2&lt;/sub&gt; .....,R&lt;sub&gt;m&lt;/sub&gt; } of resources.&lt;br /&gt;
&lt;strong&gt;(c)&lt;/strong&gt; A directed edge from a process to a resource, P&lt;sub&gt;i &lt;/sub&gt;→ R&lt;sub&gt;j&lt;/sub&gt;, implies that P&lt;sub&gt;i&lt;/sub&gt; has requested R&lt;sub&gt;j&lt;/sub&gt;.&lt;br /&gt;
&lt;strong&gt;(d)&lt;/strong&gt; A directed edge from a resource to a process, R&lt;sub&gt;j&lt;/sub&gt; → P&lt;sub&gt;i&lt;/sub&gt;, implies that R&lt;sub&gt;j&lt;/sub&gt; has been allocated by P&lt;sub&gt;i&lt;/sub&gt;.&lt;br /&gt;
&lt;strong&gt;(e)&lt;/strong&gt; If the graph has no cycles, deadlock cannot exist. If the graph has a cycle, deadlock may exist.&lt;br /&gt;
&lt;strong&gt;Example:&lt;/strong&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;strong&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjS_m__jYtKNAryqW_b2rV-m5NMoHqMoccscR79lKdmAw9ayR-gUuKbb0Lth8EQWuwd4X0C4Ztv9Iun5EVe6e0LT0LBrV6FfC9gggwLKJ-4Hckrcm7r3yk84gsL0cqiJyR5enFVLsQvzQ/s1600/Diagram-of-Resource-Allocation-Graph-example.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Diagram-of-Resource-Allocation-Graph-example&quot; border=&quot;0&quot; data-original-height=&quot;803&quot; data-original-width=&quot;1600&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjS_m__jYtKNAryqW_b2rV-m5NMoHqMoccscR79lKdmAw9ayR-gUuKbb0Lth8EQWuwd4X0C4Ztv9Iun5EVe6e0LT0LBrV6FfC9gggwLKJ-4Hckrcm7r3yk84gsL0cqiJyR5enFVLsQvzQ/s640/Diagram-of-Resource-Allocation-Graph-example.webp&quot; title=&quot;Diagram-of-Resource-Allocation-Graph-example&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: purple;&quot;&gt;External Links:-&lt;/span&gt;&lt;/h3&gt;
1. Logical and Physical Address Space - (&lt;a href=&quot;https://www.geeksforgeeks.org/logical-and-physical-address-in-operating-system/&quot; target=&quot;_blank&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
2. Resource Allocation Graph - (&lt;a href=&quot;https://www.geeksforgeeks.org/resource-allocation-graph-rag-in-operating-system/&quot; target=&quot;_blank&quot;&gt;click here&lt;/a&gt;)&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/629093000153466835'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/629093000153466835'/><link rel='alternate' type='text/html' href='https://www.allbca.com/2020/05/logical-physical-address-space-and-resource-allocation-graph.html' title='Logical &amp; Physical Address Space | Resource Allocation Graph'/><author><name>Mayank Rana</name><uri>http://www.blogger.com/profile/06163424302596650438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs9mOMQbRjoNrVnY7AbBycXEpeOG7szPXA2y_RbbeTVJ25GEGpq6q-gZxcoKqROoy4G51CI9ZCvXhjBXCUH8gb-MvrIfJnbBBdt4BY6sgH3zI2blMucgSoV-XQYw6d9g/s125/mayankrana.webp'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj78DfF9p8hutK6sGMX9vzxZtEQh3ZHvEUAWdxLIGhZuzC7VwVoeSANnn0zPAOCsogYzljrgGv9HUW4iqn3ipffYYMwOhf61MyyXmw3GjU6uyY9BOtEE2G90RjcUV5nBVn0Zi4RQOfo_A/s72-c/Logical-and-Physical-Address-Space-in-Operating-System.webp" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5313576602653501716.post-95544268156002879</id><published>2020-05-08T09:29:00.003+05:30</published><updated>2020-05-08T10:39:46.114+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Operating-System"/><title type='text'>Real Time, Time Sharing, Batch Processing Operating System</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;a href=&quot;https://www.allbca.com/2020/03/Operating-System-Notes-BCA.html&quot;&gt;&lt;strong&gt;Operating System&lt;/strong&gt;&lt;/a&gt;: Q1.&lt;strong&gt;What is Time sharing Operating System&lt;/strong&gt;? Q2.&lt;strong&gt;What is Real Time Operating System&lt;/strong&gt;? Q3.&lt;strong&gt;What is Batch Processing&lt;/strong&gt;? &lt;strong&gt;(&lt;a href=&quot;https://www.allbca.com/search/label/Operating-System&quot;&gt;Operating System all notes&lt;/a&gt;)&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjREifipAOuItLS_fFrXqliD5R0HRRcSwEN01a_4PEy5_sdlOTD1qL5YxzcOhnGoBOhWrDHAahCVzk4TNHDDD7aDgpmzu81SdDFzaLDHD9crEw7AAhRsp_lr0UYgbyrorKQ3BY9mLbtSw/s1600/Time-Sharing-Real-Time-Batch-Processing-Operating-System.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Time-Sharing-Real-Time-Batch-Processing-Operating-System&quot; border=&quot;0&quot; data-original-height=&quot;600&quot; data-original-width=&quot;800&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjREifipAOuItLS_fFrXqliD5R0HRRcSwEN01a_4PEy5_sdlOTD1qL5YxzcOhnGoBOhWrDHAahCVzk4TNHDDD7aDgpmzu81SdDFzaLDHD9crEw7AAhRsp_lr0UYgbyrorKQ3BY9mLbtSw/s640/Time-Sharing-Real-Time-Batch-Processing-Operating-System.webp&quot; title=&quot;Time-Sharing-Real-Time-Batch-Processing-Operating-System&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q1. What is Time sharing Operating System?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans. Time Sharing Operating System:&lt;/strong&gt; The time sharing mode refers to the use of a single computer system by many users simultaneously. Multiple jobs are executed by the CPU switching between them but the switches occur so frequently that the CPU may interact with each program while it is running.&lt;br /&gt;
&lt;br /&gt;
A time-shared operating system allows the many users to share the computer simultaneously. The user program is queued up and executed for a fixed amount of time (time slice), after which it&#39;s status is same and the next user requests from the job queue is executed, since each action or command in a time-shared system tends to be short, only a little CPU time is needed for each other.&lt;br /&gt;
&lt;br /&gt;
As the system switches rapidly from one user to next, each user is given the impression that the user had own computer, whereas actually one computer is being shared among many users.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q2. What is Real Time Operating System?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans. Real Time:&lt;/strong&gt; A real time system is used when there is a rigid time requirement on the operation of a processor or the flow of data and thus is often used as a control device in a delicated application system. The system that controls scientific experiments, industrial control systems, and some display systems are real time systems.&lt;br /&gt;
&lt;br /&gt;
A real time operating system has well defined fixed time constraints. Processing must be done within the different constraints or the system will fail. A real time system is considered to function correctly only if it returns the correct results in any time constraints.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;strong&gt;There are two types of real time systems:&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;(a) Hard Real Time System:&lt;/strong&gt; A hard real time system completes critical tasks on time. This goal requires that all delays in the system we bounded from the retrival of stored data to the time.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;(b) Soft Real Time System:&lt;/b&gt; A less restrictive type of real time system is a soft real time system, where a critical real time system gets priority over other task and retains that priority until it completes soft real time system that have more limited utility than hard real time system.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q3. What is Batch Processing?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans. Batch Processing:&lt;/strong&gt; This strategy involves reading a series of jobs (called a batch) into the machine and then executing the programs for each job in the batch. This approach does not allow users to interact with programs while they operate.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMeu_StGbUs6inAhUQmLKeeKAZ3BmJSDOXGE4CCSkOCqx7gg6APcycMRgxzbXxAzogjvdn9JpfCywdgrEogfwPcyIbpoUkusw5lhmBNv_ZHFmuzKl4kxVwBApfFrY5LoxvU-22U1jmhw/s1600/Batch-Processing-Diagram.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Batch-Processing-Diagram&quot; border=&quot;0&quot; data-original-height=&quot;352&quot; data-original-width=&quot;1600&quot; height=&quot;140&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMeu_StGbUs6inAhUQmLKeeKAZ3BmJSDOXGE4CCSkOCqx7gg6APcycMRgxzbXxAzogjvdn9JpfCywdgrEogfwPcyIbpoUkusw5lhmBNv_ZHFmuzKl4kxVwBApfFrY5LoxvU-22U1jmhw/s640/Batch-Processing-Diagram.webp&quot; title=&quot;Batch-Processing-Diagram&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
In a batch processing operating system environment, users submit jobs to a central place where these jobs are collected into a batch and subsequently placed on an input queue at the computer where they will be run.&lt;br /&gt;
&lt;br /&gt;
In this, the user has no interaction with the job during its processing and the computer&#39;s response time is the turn around time to time from submission of the job until execution is complete and the results are ready for the return to the person who submitted the job.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: purple;&quot;&gt;External Links:-&lt;/span&gt;&lt;/h3&gt;
1. Time sharing Operating System - (&lt;a href=&quot;https://www.tutorialspoint.com/time-sharing-operating-system&quot; target=&quot;_blank&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
2. Real Time Operating System - (&lt;a href=&quot;https://en.wikipedia.org/wiki/Real-time_operating_system&quot; target=&quot;_blank&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
2. Batch Processing - (&lt;a href=&quot;https://en.wikipedia.org/wiki/Batch_processing&quot; target=&quot;_blank&quot;&gt;click here&lt;/a&gt;)&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/95544268156002879'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/95544268156002879'/><link rel='alternate' type='text/html' href='https://www.allbca.com/2020/05/time-sharing-real-time-batch-processing-operating-system.html' title='Real Time, Time Sharing, Batch Processing Operating System'/><author><name>Mayank Rana</name><uri>http://www.blogger.com/profile/06163424302596650438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs9mOMQbRjoNrVnY7AbBycXEpeOG7szPXA2y_RbbeTVJ25GEGpq6q-gZxcoKqROoy4G51CI9ZCvXhjBXCUH8gb-MvrIfJnbBBdt4BY6sgH3zI2blMucgSoV-XQYw6d9g/s125/mayankrana.webp'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjREifipAOuItLS_fFrXqliD5R0HRRcSwEN01a_4PEy5_sdlOTD1qL5YxzcOhnGoBOhWrDHAahCVzk4TNHDDD7aDgpmzu81SdDFzaLDHD9crEw7AAhRsp_lr0UYgbyrorKQ3BY9mLbtSw/s72-c/Time-Sharing-Real-Time-Batch-Processing-Operating-System.webp" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5313576602653501716.post-7816207357488263972</id><published>2020-05-07T10:38:00.001+05:30</published><updated>2020-05-08T07:53:12.974+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Operating-System"/><title type='text'>Operating System - its Role, Services, Goals and Functions</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;a href=&quot;https://www.allbca.com/2020/03/Operating-System-Notes-BCA.html&quot;&gt;&lt;strong&gt;Operating System&lt;/strong&gt;&lt;/a&gt;: Q1.&lt;strong&gt;What is an Operating System&lt;/strong&gt;? and its Role? Q2.&lt;strong&gt;Discuss the different Services of Operating System&lt;/strong&gt;? Q3.&lt;strong&gt;What is an Operating System&lt;/strong&gt;? Discuss various goals and functions? &lt;strong&gt;(&lt;a href=&quot;https://www.allbca.com/search/label/Operating-System&quot;&gt;Operating System all notes&lt;/a&gt;)&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiohcuFlimx2TiHkZB0VowyM-jv1orT4b7CMFenhARGfwY2ggfihS9AqkGWsqfvcCtmCTviFhZ6TE66tsnHGxD7om6T6W25p8rjwpCaBr7g19mUy7rzKBew3hQwMBzHbTv7H-hwR8p_Yg/s1600/operating-system-and-its-types-role-services-goals-functions.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;operating-system-and-its-types-role-services-goals-functions&quot; border=&quot;0&quot; data-original-height=&quot;600&quot; data-original-width=&quot;800&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiohcuFlimx2TiHkZB0VowyM-jv1orT4b7CMFenhARGfwY2ggfihS9AqkGWsqfvcCtmCTviFhZ6TE66tsnHGxD7om6T6W25p8rjwpCaBr7g19mUy7rzKBew3hQwMBzHbTv7H-hwR8p_Yg/s640/operating-system-and-its-types-role-services-goals-functions.webp&quot; title=&quot;operating-system-and-its-types-role-services-goals-functions&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q1. What is an Operating System? Discuss the Role of an Operating System?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans. &lt;/strong&gt;An operating system(OS) is a program that acts as an interface between a user of a computer and computer hardware. In other words, it co-ordinates the flow of information from the computer to the user and &lt;em&gt;vice versa&lt;/em&gt;.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg342OPxDtJeieetKotJlMkMepqhit6nJ78rXdv-KqSoqqlDzIvzJtdc4kt8kvjGwydpFVtH8GP_31n1OHzoa52wv1gne9AuPNH7ZLjBnDarMyzrqXIQ-V0ss8AS28-tH48jWkuFRuoOw/s1600/Operating-System-Diagram.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Operating-System-Diagram&quot; border=&quot;0&quot; data-original-height=&quot;761&quot; data-original-width=&quot;1600&quot; height=&quot;304&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg342OPxDtJeieetKotJlMkMepqhit6nJ78rXdv-KqSoqqlDzIvzJtdc4kt8kvjGwydpFVtH8GP_31n1OHzoa52wv1gne9AuPNH7ZLjBnDarMyzrqXIQ-V0ss8AS28-tH48jWkuFRuoOw/s640/Operating-System-Diagram.webp&quot; title=&quot;Operating-System-Diagram&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
As a simple analogy, if the computer is an automobile the OS is the driver so why the automobile is complete in itself as a piece of machinery, it will not provide any function on its own, it requires a driver. An Operating System is a control program that controls the execution of the user programmer to prevent errors in the proper use of the computer.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
&lt;span style=&quot;color: green;&quot;&gt;Operating System as a Resource Manager:&lt;/span&gt;&lt;/h4&gt;
A computer is a collection of resources for the movement storage and processing of the data for the control of these functions. The OS is responsible for managing these resources. A computer system has many resources (hardware and software) that may be required to solve problems - CPU time, processor allocation, memory space, file storage space, I/O devices, and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;Role of an Operating System:&lt;/span&gt;&lt;/h3&gt;
The operating system provides a working environment to execute programs in a convenient and efficient manner. It is responsible for overall functioning from booting to the resource manager. It provides an important role for:&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;1.&lt;/strong&gt; Managing all the devices.&lt;br /&gt;
&lt;strong&gt;2.&lt;/strong&gt; Managing the memory allocation and de-allocation to process.&lt;br /&gt;
&lt;strong&gt;3.&lt;/strong&gt; Provides an interface between user and system.&lt;br /&gt;
&lt;strong&gt;4.&lt;/strong&gt; Protection of system and data,&lt;br /&gt;
&lt;strong&gt;5.&lt;/strong&gt; Managing the files and disks.&lt;br /&gt;
&lt;strong&gt;6.&lt;/strong&gt; Scheduling the computational process.&lt;br /&gt;
&lt;strong&gt;7.&lt;/strong&gt; Sharing of resources in terms of time, space, and CPU to achieve optimal utilization of resources.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Resource allocation and management acts as :&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;(a)&lt;/strong&gt; Process management.&lt;br /&gt;
&lt;strong&gt;(b)&lt;/strong&gt; Memory management.&lt;br /&gt;
&lt;strong&gt;(c)&lt;/strong&gt; I/O management.&lt;br /&gt;
&lt;strong&gt;(d)&lt;/strong&gt; File System/Disk Management.&lt;br /&gt;
&lt;strong&gt;(e)&lt;/strong&gt; Scheduling of services.&lt;br /&gt;
&lt;strong&gt;(f)&lt;/strong&gt; Security and protection of the system.&lt;br /&gt;
&lt;strong&gt;(g)&lt;/strong&gt; Services of OS in various environments.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q2. Discuss the different Services of Operating System?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans. &lt;/strong&gt;An operating system provides an environment for the execution of the programs. The operating system provides certain services to programs and to the user of these programs.&lt;br /&gt;
&lt;br /&gt;
The specific services provided will ofcourse differ from one operating system to another but there are some common classes of services that can be identified. These OS functions are provided for the convenience of the programmer to make the programming task easier.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;The OS provides services in the following areas:&lt;/strong&gt;&lt;br /&gt;
&lt;h4&gt;
&lt;span style=&quot;color: green;&quot;&gt;1. Program Execution:&lt;/span&gt;&lt;/h4&gt;
Users will want to execute programs. The system must be able to load a program into memory and run it. The program must be able to end its execution, either normally or abnormally.&lt;br /&gt;
&lt;h4&gt;
&lt;span style=&quot;color: green;&quot;&gt;2. Input/Output Operations:&lt;/span&gt;&lt;/h4&gt;
A running program may require input and output. This input/output may involve a file or an 1/0 device. For specific devices, special functions may be desired &lt;em&gt;(such as rewind a tape drive)&lt;/em&gt;.&lt;br /&gt;
&lt;h4&gt;
&lt;span style=&quot;color: green;&quot;&gt;3. File System Manipulation:&lt;/span&gt;&lt;/h4&gt;
The file system is of particular interest. It must maintain that programers want to read and write files, we also want to create and delete files by name.&lt;br /&gt;
&lt;h4&gt;
&lt;span style=&quot;color: green;&quot;&gt;4. Communication:&lt;/span&gt;&lt;/h4&gt;
There are many circumstances in which one process needs to exchange information with another process. There are two major ways in which such communication can occur. The first takes place between process executing on the same computer, the second takes place between processes executing on different computers system that are tied together by a computer network.&lt;br /&gt;
&lt;br /&gt;
Communications may be implemented via shared or by the technique of message passing in which packets of informations are moved between processes by the operating system.&lt;br /&gt;
&lt;h4&gt;
&lt;span style=&quot;color: green;&quot;&gt;5. Error Detection:&lt;/span&gt;&lt;/h4&gt;
The Operating system constantly needs to be aware of possible errors. Errors may occur in the CPU and memory hardware &lt;em&gt;(such as in-memory error or a power failure)&lt;/em&gt;, in I/O devices &lt;em&gt;(such as parity errors on tape, a card Jam in the card reader, or the printer out of paper)&lt;/em&gt;.&lt;br /&gt;
For each type of error the operating system should take the appropriate action to ensure, the operating system does correct and consistent computing.&lt;br /&gt;
&lt;h4&gt;
&lt;span style=&quot;color: green;&quot;&gt;6. Resource Allocation:&lt;/span&gt;&lt;/h4&gt;
When there are multiple users or multiple jobs running at the same time, resources must be allocated to each of them. Many different types of resources are managed by the operating system. Some &lt;em&gt;(such as CPU cycles, main memory, and file storage)&lt;/em&gt; may have special allocation code, while others &lt;em&gt;(such as I/O devices)&lt;/em&gt; may have much more general requests and release code.&lt;br /&gt;
&lt;h4&gt;
&lt;span style=&quot;color: green;&quot;&gt;7. Accounting:&lt;/span&gt;&lt;/h4&gt;
We want to keep track of which user use how much and what kind of computer resources. This record-keeping may be for the purpose of paying for accumulating usage, statistics may be a valuable tool in trying to configure the system to improve computing services.&lt;br /&gt;
&lt;h4&gt;
&lt;span style=&quot;color: green;&quot;&gt;8. Protection:&lt;/span&gt;&lt;/h4&gt;
The owner of information stored in a particular system may want to control its use. When several disjoint jobs are being executed simultaneously in order to increase its utilization, it should not be possible for one job to interface with the others. In addition, conflicting demands for various resources need to be managed rarely and scheduled reasonably.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q3. What is an Operating System? Discuss various Goals and Functions of an Operating System?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans. &lt;/strong&gt;The 1960&#39;s definition of an operating system(OS) was &quot;the software that controls the hardware&quot;. The OS is an organized collection of programs to provide an extension for hardware. It lies under the system software category. We see an operating system as the programs that make the hardware usable. In brief; an OS is the set of programs that controls a computer.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Some examples&lt;/strong&gt; of&amp;nbsp; OS are UNIX, Mach, MS-DOS, MS-similar small instruments where memory and resources are crucial. A Real-Time Operating System (RTOS) is a multitasking operating system intended for real-time applications. Such applications include embedded systems &lt;em&gt;(programmable thermostats, household appliance controllers, mobile teleph&lt;/em&gt;&lt;em&gt;ones)&lt;/em&gt;, industrial robots, spacecraft, industrial control, and scientific research equipment.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;An operating system&lt;/strong&gt; is a program that acts as an interface between a user of a computer and computer hardware, also provides an environment in which a user may execute programs. Program execution environment provides services like :&lt;br /&gt;
&lt;strong&gt;1.&lt;/strong&gt; Memory management.&lt;br /&gt;
&lt;strong&gt;2.&lt;/strong&gt; I/O device management.&lt;br /&gt;
&lt;strong&gt;3.&lt;/strong&gt; File system support.&lt;br /&gt;
&lt;strong&gt;4.&lt;/strong&gt; Job scheduling.&lt;br /&gt;
&lt;strong&gt;5.&lt;/strong&gt; Swapping of other programs etc.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;In another way&lt;/strong&gt; we can say that the Operating System(OS) is a class of programs that manage the resources of the computer, process commands, efficiently utilizes the computer hardware, and controls program execution. The OS is important for almost every computer system. It acts as a co-ordinator for every interaction activity between the users and their computer system.&lt;br /&gt;
&lt;br /&gt;
The following figure shows the abstract view of the components of a computer system. A user can communicate with the OS using any of the two basic approaches : It provides basic computing resources &lt;em&gt;(CPU, memory, I/O devices)&lt;/em&gt;.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwlCFW4hKIybEhG_E1_QnrA4yNACaZAi5Fj86grwPol6qqdgpuVOhgoGqT-0xQGWr1zD_1HR_3P7AgqaoWBwgTIqFAMDfT0byNUVyoh_AIyajptg_6-ZAETzkbkYAJgXmmlP83VcQa-A/s1600/Components-of-Computer-System-or-Operating-System.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Components-of-Computer-System-or-Operating-System&quot; border=&quot;0&quot; data-original-height=&quot;574&quot; data-original-width=&quot;1600&quot; height=&quot;228&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwlCFW4hKIybEhG_E1_QnrA4yNACaZAi5Fj86grwPol6qqdgpuVOhgoGqT-0xQGWr1zD_1HR_3P7AgqaoWBwgTIqFAMDfT0byNUVyoh_AIyajptg_6-ZAETzkbkYAJgXmmlP83VcQa-A/s640/Components-of-Computer-System-or-Operating-System.webp&quot; title=&quot;Components-of-Computer-System-or-Operating-System&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;strong&gt;1. Hardware:&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;2. Operating System:&lt;/strong&gt; It controls and coordinates the use of the hardware among the various application programs for the various users.&lt;br /&gt;
&lt;strong&gt;3. Application Programs:&lt;/strong&gt; It defines the ways in which the system resources are used to solve the computing problems of the users &lt;em&gt;(compilers, database systems, video games, business programs)&lt;/em&gt;.&lt;br /&gt;
&lt;strong&gt;4. Users:&lt;/strong&gt; It includes people, machines, and other computers.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;Objectives or Goals of Operating System.&lt;/span&gt;&lt;/h3&gt;
&lt;strong&gt;It is easier to define the OS by knowing the following functions :&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;1. Convenience:&lt;/strong&gt; An OS makes a computer more convenient to use. The primary goal of an OS is to make a very friendly nature for every user.&lt;br /&gt;
&lt;strong&gt;2. Efficiency:&lt;/strong&gt; In this, the objective of a computer is to execute an instruction in an efficient manner and to increase the productivity of processing resources attached with the system.&lt;br /&gt;
&lt;strong&gt;3. Ability to Evaluate:&lt;/strong&gt; An operating system should be constructed in such a way so that it permits the effective development testing and instructions of the new system.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;Functions of Operating System&lt;/span&gt;&lt;/h3&gt;
It manages many kinds of activities ranging from the user program to system programs like printer spooler, file server, etc.&lt;br /&gt;
&lt;h4&gt;
&lt;span style=&quot;color: green;&quot;&gt;1. Process Management:&lt;/span&gt;&lt;/h4&gt;
There are many activities encapsulated in a process. A process includes the complete execution context (code, data, resources, etc.) The five major activities of an operating system in regard to process management are :&lt;br /&gt;
&lt;strong&gt;(a)&lt;/strong&gt; Creation of user processes.&lt;br /&gt;
&lt;strong&gt;(b)&lt;/strong&gt; Creation of system processes.&lt;br /&gt;
&lt;strong&gt;(c)&lt;/strong&gt; Deletion of user processes.&lt;br /&gt;
&lt;strong&gt;(d)&lt;/strong&gt; Deletion of system processes.&lt;br /&gt;
&lt;strong&gt;(e)&lt;/strong&gt; Suspension of processes.&lt;br /&gt;
&lt;h4&gt;
&lt;span style=&quot;color: green;&quot;&gt;2. Memory Management:&lt;/span&gt;&lt;/h4&gt;
Main memory provides storage that can be accessed directly by the CPU, i.e., for the program to be executed, it must be in the main memory. The major activities of an operating system in regard to memory management are :&lt;br /&gt;
&lt;strong&gt;(a)&lt;/strong&gt; Keep track of which part of memory are currently being used and by whom.&lt;br /&gt;
&lt;strong&gt;(b)&lt;/strong&gt; Allocate and deallocate memory space as needed.&lt;br /&gt;
&lt;h4&gt;
&lt;span style=&quot;color: green;&quot;&gt;3. Secondary Storage Management:&lt;/span&gt;&lt;/h4&gt;
Secondary storage consists of tapes, disks, and other media designed to hold information that will eventually be accessed in primary storage, ordinarily divided into bytes or words consisting of a fixed number of bytes. The three major activities of an operating system in regard to secondary storage management are :&lt;br /&gt;
&lt;strong&gt;(a)&lt;/strong&gt; Allocation of storage space when new files have to be written.&lt;br /&gt;
&lt;strong&gt;(b)&lt;/strong&gt; Scheduling the requests for memory access.&lt;br /&gt;
&lt;h4&gt;
&lt;span style=&quot;color: green;&quot;&gt;4. File Management:&lt;/span&gt;&lt;/h4&gt;
A file is a collection of related information defined by its creator. The computer can store files on the disk, which provides long term storage. A file system is normally organized into directories to ease their use.&lt;br /&gt;
&lt;strong&gt;(a)&lt;/strong&gt; The creation and deletion of files.&lt;br /&gt;
&lt;strong&gt;(b)&lt;/strong&gt; The mapping of files into secondary storage.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;5.1/O System Management:&lt;/span&gt;&lt;/h3&gt;
I/O subsystem hides the specific hardware devices from the user. Only the device driver knows the peculiarities of the device to whom it is assigned.&lt;br /&gt;
&lt;h4&gt;
&lt;span style=&quot;color: green;&quot;&gt;Protection System:&lt;/span&gt;&lt;/h4&gt;
If a computer system has multiple users and allows the concurrent execution of multiple processes, then the various processes must be protected from one another&#39;s activities. Protection refers to a mechanism for controlling the access of programs or users to the resources defined by the systems.&lt;br /&gt;
&lt;h4&gt;
&lt;span style=&quot;color: green;&quot;&gt;Networking:&lt;/span&gt;&lt;/h4&gt;
A distributed system is a collection of processors that do not share memory. The processors communicate with one another through communication lines called networks. The communication network design must consider routing and connection with security.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: purple;&quot;&gt;External Links:-&lt;/span&gt;&lt;/h3&gt;
1. Operating System - (&lt;a href=&quot;https://en.wikipedia.org/wiki/Operating_system&quot;&gt;click here&lt;/a&gt;)&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/7816207357488263972'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/7816207357488263972'/><link rel='alternate' type='text/html' href='https://www.allbca.com/2020/05/operating-system-and-types-role-services-functions.html' title='Operating System - its Role, Services, Goals and Functions'/><author><name>Mayank Rana</name><uri>http://www.blogger.com/profile/06163424302596650438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs9mOMQbRjoNrVnY7AbBycXEpeOG7szPXA2y_RbbeTVJ25GEGpq6q-gZxcoKqROoy4G51CI9ZCvXhjBXCUH8gb-MvrIfJnbBBdt4BY6sgH3zI2blMucgSoV-XQYw6d9g/s125/mayankrana.webp'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiohcuFlimx2TiHkZB0VowyM-jv1orT4b7CMFenhARGfwY2ggfihS9AqkGWsqfvcCtmCTviFhZ6TE66tsnHGxD7om6T6W25p8rjwpCaBr7g19mUy7rzKBew3hQwMBzHbTv7H-hwR8p_Yg/s72-c/operating-system-and-its-types-role-services-goals-functions.webp" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5313576602653501716.post-6669358365794185176</id><published>2020-05-04T13:57:00.004+05:30</published><updated>2020-05-04T13:57:42.649+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Operating-System"/><title type='text'>Virtual Memory in OS vs Virtual Device | 100% Easy Notes</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;a href=&quot;https://www.allbca.com/2020/03/Operating-System-Notes-BCA.html&quot;&gt;&lt;strong&gt;Operating System&lt;/strong&gt;&lt;/a&gt;: Q1.&lt;strong&gt;What is Virtual Memory in OS&lt;/strong&gt;? Q2.&lt;strong&gt;What is Virtual Device&lt;/strong&gt;? What are the advantages of virtual device? Q3.Explain the &lt;strong&gt;concept of virtual memory&lt;/strong&gt;&amp;nbsp; in OS and &lt;strong&gt;how it is obtained by demand paging and segmentation&lt;/strong&gt;? &lt;strong&gt;(&lt;a href=&quot;https://www.allbca.com/search/label/Operating-System&quot;&gt;Operating System all notes&lt;/a&gt;)&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6cFW14HwbOixKhI4M-84CSmAZYZSjEnZy9Qv0xVIpqgrp8xTdD0Fqm08QeVCDWpJQg21zPQ47iy-dSDgJlfBqDXv32BE9tX2gba1o-dOBQ6z0zIL_7k17Tj9eNyNGRWH2VCDTp69hOA/s1600/Virtual-Memory-vs-Virtual-Device-in-OS.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Virtual-Memory-vs-Virtual-Device-in-OS&quot; border=&quot;0&quot; data-original-height=&quot;600&quot; data-original-width=&quot;800&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6cFW14HwbOixKhI4M-84CSmAZYZSjEnZy9Qv0xVIpqgrp8xTdD0Fqm08QeVCDWpJQg21zPQ47iy-dSDgJlfBqDXv32BE9tX2gba1o-dOBQ6z0zIL_7k17Tj9eNyNGRWH2VCDTp69hOA/s640/Virtual-Memory-vs-Virtual-Device-in-OS.webp&quot; title=&quot;Virtual-Memory-vs-Virtual-Device-in-OS&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q1. What is Virtual Memory in OS?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans. Virtual Memory in OS:&lt;/strong&gt; An imaginary memory area supported by some operating systems (for example, Windows but not DOS) in conjunction with the hardware. We can think of virtual memory &lt;span style=&quot;color: #999999;&quot;&gt;in OS&lt;/span&gt; as an alternate set of memory addresses.&lt;br /&gt;
Programs use these virtual addresses rather than real addresses to store instructions and data. When the program is actually executed, the virtual addresses are converted into real memory addresses.&lt;br /&gt;
&lt;br /&gt;
The purpose of virtual memory &lt;span style=&quot;color: #999999;&quot;&gt;in OS&lt;/span&gt; is to enlarge the address space, the set of addresses a program can utilize. &lt;strong&gt;For example&lt;/strong&gt;, virtual memory &lt;span style=&quot;color: #999999;&quot;&gt;in OS&lt;/span&gt; might contain twice as many addresses aš main memory.&lt;br /&gt;
A program using all of virtual memory&lt;span style=&quot;color: #999999;&quot;&gt; in OS&lt;/span&gt;, therefore, would not be able to fit in the main memory all at once. Nevertheless, the computer could execute such a program by copying into main memory those portions of the program needed at any given point during execution.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs1wgXpMyDoSmnkKXoE7-k6foSZGHVhb1fEWw8FL1HCbdH6ajgX1HoKZ1u1mjgk47iBtqC_XpzHfY7ZBFeJYiSE7o3ndh-5VkYzHB-wixqmg44uy1fx3oItuFtrSTiLJEcHqM738Hogg/s1600/Virtual-Memory-Diagram.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Virtual-Memory-Diagram&quot; border=&quot;0&quot; data-original-height=&quot;837&quot; data-original-width=&quot;1600&quot; height=&quot;334&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs1wgXpMyDoSmnkKXoE7-k6foSZGHVhb1fEWw8FL1HCbdH6ajgX1HoKZ1u1mjgk47iBtqC_XpzHfY7ZBFeJYiSE7o3ndh-5VkYzHB-wixqmg44uy1fx3oItuFtrSTiLJEcHqM738Hogg/s640/Virtual-Memory-Diagram.webp&quot; title=&quot;Virtual-Memory-Diagram&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
To facilitate copying virtual memory into real memory, the operating system divides virtual memory into pages, each of which contains a fixed number of addresses. Each page is stored on a disk until it is needed. When the page is needed, the operating system copies it from disk to main memory, translating the virtual addresses into real addresses.&lt;br /&gt;
&lt;br /&gt;
The process of translating virtual addresses into real addresses is called &lt;strong&gt;Mapping&lt;/strong&gt;. The copying of virtual pages from disk to main memory is known as &lt;strong&gt;Paging&lt;/strong&gt; or &lt;strong&gt;Swapping&lt;/strong&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q2. What is Virtual Device? What are the advantages of virtual device?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans. Virtual Devices:&lt;/strong&gt; A virtual device mimics a physical hardware device, fundamentally tricking the CPU into believing that a device exists when it really doesn&#39;t.&lt;br /&gt;
&lt;strong&gt;For example&lt;/strong&gt;, fax software can act as a virtual printer. When the print is selected, the document is sent to a fax/modem, which then sends information to another fax/modem or fax machine instead of a printer printing the file.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;Advantages of Virtual Devices:&lt;/span&gt;&lt;/h3&gt;
&lt;strong&gt;The advantages of virtual devices are:&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;(a)&lt;/strong&gt; They are used to fix an error in the operating system. &lt;strong&gt;For example&lt;/strong&gt;, a bug or a virus can be detected by supposing an external device is monitoring it.&lt;br /&gt;
&lt;strong&gt;(b)&lt;/strong&gt; Virtual devices reduce the networking hardware investment and eliminate dependencies on hardware.&lt;br /&gt;
&lt;strong&gt;(c)&lt;/strong&gt; They simplify management and access with centralized access control.&lt;br /&gt;
&lt;strong&gt;(d)&lt;/strong&gt; Virtual devices allow us to reduce or eliminate the overhead associated with traditional networking components.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q3. Explain the concept of virtual memory in OS and how it is obtained by demand paging and segmentation?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans. Virtual Memory in OS:&lt;/strong&gt; Virtual memory is a memory hierarchy consisting of a computer system&#39;s memory and a disk, that enables a process to operate with only some portions of its address space in memory.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Virtual memory&lt;/strong&gt; is implemented by demand paging. It is also implemented in a segmentation system. Several systems proved paged segmentation where segments are broken into pages but the operating system can implement this scheme with demand paging.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Demand segmentation&lt;/strong&gt; can also be used to provide virtual memory. The segment replacement algorithm is very complex in use because of variable sizes of segments while the page replacement algorithm is easy to use and implement.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Virtual memory&lt;/strong&gt; allows the execution of partially loaded processes. As a consequence, the sum of the virtual address space of active processes in a virtual-memory system can exceed. The capacity of the available physical memory provided that the physical memory is large enough to hold a minimum amount of the address space of each active process.&lt;br /&gt;
&lt;br /&gt;
Thus, whereas the real memory system strive to approach 100% utilization of physical memory: The virtual memory system routinely provide apparent utilization factors in excess of 100%.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: purple;&quot;&gt;External Links:-&lt;/span&gt;&lt;/h3&gt;
1. Virtual Memory in OS - (&lt;a href=&quot;https://www.geeksforgeeks.org/virtual-memory-in-operating-system/&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
2. Virtual Device in Operating System - (&lt;a href=&quot;https://en.wikipedia.org/wiki/Virtual_device&quot;&gt;click here&lt;/a&gt;)&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/6669358365794185176'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/6669358365794185176'/><link rel='alternate' type='text/html' href='https://www.allbca.com/2020/05/virtual-memory-vs-virtual-device-in-os.html' title='Virtual Memory in OS vs Virtual Device | 100% Easy Notes'/><author><name>Mayank Rana</name><uri>http://www.blogger.com/profile/06163424302596650438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs9mOMQbRjoNrVnY7AbBycXEpeOG7szPXA2y_RbbeTVJ25GEGpq6q-gZxcoKqROoy4G51CI9ZCvXhjBXCUH8gb-MvrIfJnbBBdt4BY6sgH3zI2blMucgSoV-XQYw6d9g/s125/mayankrana.webp'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6cFW14HwbOixKhI4M-84CSmAZYZSjEnZy9Qv0xVIpqgrp8xTdD0Fqm08QeVCDWpJQg21zPQ47iy-dSDgJlfBqDXv32BE9tX2gba1o-dOBQ6z0zIL_7k17Tj9eNyNGRWH2VCDTp69hOA/s72-c/Virtual-Memory-vs-Virtual-Device-in-OS.webp" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5313576602653501716.post-4721344092720745618</id><published>2020-05-03T14:05:00.001+05:30</published><updated>2020-05-03T14:17:18.932+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Operating-System"/><title type='text'>Critical Section Problem in OS - 3 conditions that are used in it</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;a href=&quot;https://www.allbca.com/2020/03/Operating-System-Notes-BCA.html&quot;&gt;&lt;strong&gt;Operating System&lt;/strong&gt;&lt;/a&gt;: Q1.&lt;strong&gt;What is Critical Section Problem in OS&lt;/strong&gt;? Q2.&lt;strong&gt;What are 3 conditions that are used in critical section problem in os&lt;/strong&gt;? &lt;strong&gt;(&lt;a href=&quot;https://www.allbca.com/search/label/Operating-System&quot;&gt;Operating System all notes&lt;/a&gt;)&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYLVUX6dzEtnDNr_csuifmyU5sdhcHvm2fJt7H6s1x0x6BP-QafDkOJsZbD_sNc3qtZI6BuA8m1oucy9illLl9ugIPSFDoLruScvFfECbGj8Pg5phwTt1uAwNorqmgIoOj5wtrL392jw/s1600/Critical-Section-Problem-in-OS.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Critical-Section-Problem-in-OS&quot; border=&quot;0&quot; data-original-height=&quot;600&quot; data-original-width=&quot;800&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYLVUX6dzEtnDNr_csuifmyU5sdhcHvm2fJt7H6s1x0x6BP-QafDkOJsZbD_sNc3qtZI6BuA8m1oucy9illLl9ugIPSFDoLruScvFfECbGj8Pg5phwTt1uAwNorqmgIoOj5wtrL392jw/s640/Critical-Section-Problem-in-OS.webp&quot; title=&quot;Critical-Section-Problem-in-OS&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q1. What is Critical Section Problem in OS?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans. Critical Section Problem in OS:&lt;/strong&gt; Given two more processes &lt;em&gt;(or threads)&lt;/em&gt; that share a resource &lt;em&gt;(e.g. variable or device)&lt;/em&gt;, we must often synchronize their activity.&lt;br /&gt;
Must satisfy to one degree or another the concepts of mutual exclusion, progress, and bounded waiting.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Example:&lt;/strong&gt; Consider only two processes critical section (&amp;lt;cs&amp;gt;): instructions that access the shared resource.&lt;br /&gt;
We must establish mutual exclusion: no two processes can be in their &amp;lt;cs&amp;gt; at the same time.&lt;br /&gt;
&lt;br /&gt;
process producer {&lt;br /&gt;
while (true) {&lt;br /&gt;
while (count == BUFFER_SIZE);&lt;br /&gt;
++count;&lt;br /&gt;
buffer[in] = item;&lt;br /&gt;
in = (in +1) % BUFFER_SIZE;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
process consumer {&lt;br /&gt;
while (true) {&lt;br /&gt;
while (count == 0);&lt;br /&gt;
--count;&lt;br /&gt;
item = buffer[out];&lt;br /&gt;
out = (out - 1) % BUFFER_SIZE;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
Assume count = 5 and both producer and consumer execute the statements ++count and --count.&lt;br /&gt;
Results? count could be set to 4, 5, or 6 (but only 5 is correct).&lt;br /&gt;
reg_1 = count&lt;br /&gt;
reg_1 = reg_1 +1&lt;br /&gt;
count = reg_1&lt;br /&gt;
reg_2 = count&lt;br /&gt;
reg_2 = reg_2 - 1&lt;br /&gt;
count = reg_2&lt;br /&gt;
&lt;strong&gt;Principle of atomicity &lt;/strong&gt;&lt;br /&gt;
t_0: producer executes reg_1 = count&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[reg_1 = 5]&lt;br /&gt;
t_1: producer executes reg_1 = reg_1 + 1&amp;nbsp; &amp;nbsp; &amp;nbsp;[reg_1 = 6]&lt;br /&gt;
t_2: consumer executes règ_2 = count&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [reg_2 = 5]&lt;br /&gt;
t_3: consumer executes reg_2 = reg_2 - 1&amp;nbsp; &amp;nbsp; [reg_2 = 4]&lt;br /&gt;
t_4: producer executes count = reg_1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[count = 6]&lt;br /&gt;
t_5: consumer executes count = reg_2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [count = 4]&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;strong&gt;Race Condition:&lt;/strong&gt;&lt;/span&gt; A situation where multiple processes access and manipulate the same data concurrently and the outcome of the execution depends on the order in which the instructions execute.&lt;br /&gt;
&lt;br /&gt;
The operating system kernel code itself can have race conditions. Preemptive vs. non-preemptive kernels. This is called the &lt;strong&gt;critical section problem&lt;span style=&quot;color: grey;&quot;&gt; in os.&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q2. What are three conditions, that are used in critical section problem?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans.&lt;/strong&gt; Following are the three conditions, that are used in this problem:&lt;br /&gt;
&lt;strong&gt;(a) Mutual Exclusion:&lt;/strong&gt; Only one process may execute its critical section at once.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;(b) Progress:&lt;/strong&gt; If no process is executing in its critical section and some processes wish to enter their critical sections, then only those processes not executing in their remainder sections can participate in the decision on which process will enter its critical section next and this decision cannot be postponed indefinitely.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;(c) Bounded Waiting:&lt;/strong&gt; This is a limit on the number of times other processes are allowed to enter their critical section after a process has made a request to enter its critical section and before that request is granted.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: purple;&quot;&gt;External Links:-&lt;/span&gt;&lt;/h3&gt;
1. Critical Section Problem in OS - (&lt;a href=&quot;https://www.javatpoint.com/os-critical-section-problem&quot; target=&quot;_blank&quot;&gt;click here&lt;/a&gt;)&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/4721344092720745618'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/4721344092720745618'/><link rel='alternate' type='text/html' href='https://www.allbca.com/2020/05/critical-section-problem-in-os.html' title='Critical Section Problem in OS - 3 conditions that are used in it'/><author><name>Mayank Rana</name><uri>http://www.blogger.com/profile/06163424302596650438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs9mOMQbRjoNrVnY7AbBycXEpeOG7szPXA2y_RbbeTVJ25GEGpq6q-gZxcoKqROoy4G51CI9ZCvXhjBXCUH8gb-MvrIfJnbBBdt4BY6sgH3zI2blMucgSoV-XQYw6d9g/s125/mayankrana.webp'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYLVUX6dzEtnDNr_csuifmyU5sdhcHvm2fJt7H6s1x0x6BP-QafDkOJsZbD_sNc3qtZI6BuA8m1oucy9illLl9ugIPSFDoLruScvFfECbGj8Pg5phwTt1uAwNorqmgIoOj5wtrL392jw/s72-c/Critical-Section-Problem-in-OS.webp" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5313576602653501716.post-1093917297579978360</id><published>2020-05-01T21:15:00.001+05:30</published><updated>2020-05-01T21:53:24.503+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Operating-System"/><title type='text'>Paging in OS | Difference between Page and Frame</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;a href=&quot;https://www.allbca.com/2020/03/Operating-System-Notes-BCA.html&quot;&gt;&lt;strong&gt;Operating System&lt;/strong&gt;&lt;/a&gt;: Q1.&lt;strong&gt;What is Paging in OS&lt;/strong&gt;? &lt;strong&gt;Difference between Page and Frame&lt;/strong&gt;? The procedure of paging and data structure involved in a paging scheme?&amp;nbsp;&lt;strong&gt;(&lt;a href=&quot;https://www.allbca.com/search/label/Operating-System&quot;&gt;Operating System all notes&lt;/a&gt;)&lt;/strong&gt; &lt;span style=&quot;color: #f3f3f3;&quot;&gt;[ Topic= Paging in OS ]&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9Kl1a_VD4kNgURwbvIMF7jVHi9qFM08J5WnVyIJCocr2zhvbCXc1m_csBdts5dFF13z78X_PnY8pbLFwCYVpYkKeKMbP-_b_9UpzmqQ4fcoM0x_vqEZMJDLGL4pCYv9hwtXv5n0LQLQ/s1600/Paging-in-Operating-System.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Paging-in-Operating-System&quot; border=&quot;0&quot; data-original-height=&quot;600&quot; data-original-width=&quot;800&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9Kl1a_VD4kNgURwbvIMF7jVHi9qFM08J5WnVyIJCocr2zhvbCXc1m_csBdts5dFF13z78X_PnY8pbLFwCYVpYkKeKMbP-_b_9UpzmqQ4fcoM0x_vqEZMJDLGL4pCYv9hwtXv5n0LQLQ/s640/Paging-in-Operating-System.webp&quot; title=&quot;Paging-in-Operating-System&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q1. What is Paging in OS? Difference between Page and Frame? The procedure of paging and data structure involved in a paging scheme?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans. Paging in OS:&lt;/strong&gt; Paging is a method of non-contiguous memory allocation. In paging, the logical address space is divided into fixed-sized blocks known as &lt;strong&gt;Pages&lt;/strong&gt;. The physical address space is also divided into fixed-size blocks known as &lt;strong&gt;Frames&lt;/strong&gt;.&lt;br /&gt;
A page is mapped into a frame. The individual pages and frames are recognized by unique numbers known as the page number and frame number respectively.&lt;br /&gt;
&lt;br /&gt;
The size of the page is equal to the size of a frame. A page number forms a part of the logical address and a frame number forms a part of a physical address.&lt;br /&gt;
&lt;br /&gt;
Both page and frame size usually a power of 2 depending on the type of hardware. If a logical address consists of &lt;em&gt;p&lt;/em&gt; number of digits, it means there are 2&lt;sup&gt;P&lt;/sup&gt; addresses in the logical address space. Similarly, if a physical address consists of &lt;em&gt;q&lt;/em&gt; number of digits, it means there are 2&lt;sup&gt;q&lt;/sup&gt; addresses in the physical address space.&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;[ Topic= Paging in OS ]&lt;/span&gt;&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;Mapping of Pages to Frames:&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt; Paging in OS&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
A logical address consists of two parts such as page number and offset. If a logical address is &lt;em&gt;p&lt;/em&gt; digits long and page size is 2&lt;sup&gt;n&lt;/sup&gt; digits long, then the higher or left most p-q digits in a logical address denote the page number and the rest of the logical address denotes offset.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;For Example:&lt;/strong&gt; A logical address space can hold 2&lt;sup&gt;13&lt;/sup&gt; addresses, it means a logical address is 13 bits long, or in other words, the logical address space is 8 KB. There are 8 pages in the logical address space that means the size of each page is 2&lt;sup&gt;10&lt;/sup&gt; bits = 1 KB.&lt;br /&gt;
&lt;br /&gt;
The size of the physical address space is 2&lt;sup&gt;12&lt;/sup&gt; bit = 4 KB, which means the physical address is 12-bit long. In a logical address of 13-bits, the higher (13-10) = 3-bits denote the page number and the rest 10-bits denotes the offset. The logical address 011 1010101010 denotes page number 011 and the offset 1010101010.&lt;br /&gt;
&lt;br /&gt;
A physical address consists of two parts such as frame number and offset. The offset is the same as it is in the corresponding logical address.&lt;br /&gt;
&lt;strong&gt;For Example:&lt;/strong&gt; In the previous example, the offset 1010101010 of the logical address 011. 1010101010 is 10-bits long.&lt;br /&gt;
&lt;br /&gt;
The physical address corresponding to this logical address can be 01 1010101010, where 01 is the frame number and 1010101010 is the offset. An operating system maintains a table to convert a logical address into its corresponding physical address. This table is called the &lt;strong&gt;Memory page table&lt;/strong&gt; or &lt;strong&gt;Page table&lt;/strong&gt;.&lt;br /&gt;
This method converting a logical address into its corresponding physical address is known as &lt;strong&gt;Address Translation&lt;/strong&gt;.&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;[ Topic= Paging in OS ]&lt;/span&gt;&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;Hierarchical Page Tables:&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt; Paging in OS&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
With the increasing need for large applications, there is also a need for larger memory space in a computer. As a result, it becomes difficult to work with long memory addresses. In a paged memory system, the page table itself becomes very lengthy. The solution to this problem is hierarchical paging.&lt;strong&gt;outer&lt;/strong&gt; and &lt;strong&gt;inner&lt;/strong&gt;. The inner page table is similar to that of the single page table scenario. The outer page table stores the links for the &lt;strong&gt;inner page table&lt;/strong&gt;. The logical address consists of three parts: outer page table entry, inner page table entry, and the offset.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpzOUQbUVdX4rtMF2xHzVfh-9NfLvkEBKyNUhdv_BiGsDXoSOwASJtQjov1QiV8iBXc4GCjd0DpSEE7aZVkVaLYzH4xCRhFDPQgyx6wckElmhGen3RgxOekbCnAqKxZRgKajoUObWjIw/s1600/Address-translation-in-paging-scheme-diagram.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Address-translation-in-paging-scheme-diagram&quot; border=&quot;0&quot; data-original-height=&quot;729&quot; data-original-width=&quot;1600&quot; height=&quot;290&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpzOUQbUVdX4rtMF2xHzVfh-9NfLvkEBKyNUhdv_BiGsDXoSOwASJtQjov1QiV8iBXc4GCjd0DpSEE7aZVkVaLYzH4xCRhFDPQgyx6wckElmhGen3RgxOekbCnAqKxZRgKajoUObWjIw/s640/Address-translation-in-paging-scheme-diagram.webp&quot; title=&quot;Address-translation-in-paging-scheme-diagram&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
In hierarchical paging, the page table itself is paged. There are two page tables : outer and inner. The inner page table is similar to that of the single page table scenario. The outer page table stores the links for the inner page table. The logical address consists of three parts : outer page table entry, inner page table entry and the offset.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYTwNILVmYDEivZptOIM5drZk6O0DfJ9rn_0CjhKm7a_IS_UUK_cFIqLTGIiOAinpXqzir0ig55YJa6OrsyrUhT8lJOwSQfzteDE3GZ2F3o11lsbUfutw8ZHrnp9SJ9W9eOZ3MzAHl5Q/s1600/Hierarchical-Paging-Scheme-diagram.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Hierarchical-Paging-Scheme-diagram&quot; border=&quot;0&quot; data-original-height=&quot;896&quot; data-original-width=&quot;1600&quot; height=&quot;358&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYTwNILVmYDEivZptOIM5drZk6O0DfJ9rn_0CjhKm7a_IS_UUK_cFIqLTGIiOAinpXqzir0ig55YJa6OrsyrUhT8lJOwSQfzteDE3GZ2F3o11lsbUfutw8ZHrnp9SJ9W9eOZ3MzAHl5Q/s640/Hierarchical-Paging-Scheme-diagram.webp&quot; title=&quot;Hierarchical-Paging-Scheme-diagram&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
In the process of hierarchical paging, a logical address has been divided into three parts :X, Y, Z. The symbol, X represents the entry in the outer page table and symbol Y represents the entry in the inner page tables. The symbol Z represents the offset.&lt;br /&gt;
&lt;br /&gt;
The X&lt;sup&gt;th&lt;/sup&gt; position in the outer page table stores the address of the inner page table associated with symbol X. The Y&lt;sup&gt;th&lt;/sup&gt; position is searched in the inner page table and symbol Y contains the address of the frame containing the searched page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;b&gt;[ Topic= Paging in OS ]&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;[ Topic= Paging in OS ]&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;b&gt;[ Topic= Paging in OS ]&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: purple;&quot;&gt;External Links:-&lt;/span&gt;&lt;/h3&gt;
1. Paging in OS -&amp;nbsp; (&lt;a href=&quot;https://www.geeksforgeeks.org/paging-in-operating-system/&quot; target=&quot;_blank&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
2. Paging in OS -&amp;nbsp; (&lt;a href=&quot;https://www.javatpoint.com/os-paging-with-example&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;[ Topic= Paging in OS ]&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;[ Topic= Paging in OS ]&lt;/b&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/1093917297579978360'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/1093917297579978360'/><link rel='alternate' type='text/html' href='https://www.allbca.com/2020/05/paging-in-os.html' title='Paging in OS | Difference between Page and Frame'/><author><name>Mayank Rana</name><uri>http://www.blogger.com/profile/06163424302596650438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs9mOMQbRjoNrVnY7AbBycXEpeOG7szPXA2y_RbbeTVJ25GEGpq6q-gZxcoKqROoy4G51CI9ZCvXhjBXCUH8gb-MvrIfJnbBBdt4BY6sgH3zI2blMucgSoV-XQYw6d9g/s125/mayankrana.webp'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9Kl1a_VD4kNgURwbvIMF7jVHi9qFM08J5WnVyIJCocr2zhvbCXc1m_csBdts5dFF13z78X_PnY8pbLFwCYVpYkKeKMbP-_b_9UpzmqQ4fcoM0x_vqEZMJDLGL4pCYv9hwtXv5n0LQLQ/s72-c/Paging-in-Operating-System.webp" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5313576602653501716.post-1379486706229453999</id><published>2020-05-01T14:28:00.000+05:30</published><updated>2020-05-01T14:52:14.562+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Operating-System"/><title type='text'>First fit Best fit Worst fit with example | Allocation Algorithm</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;a href=&quot;https://www.allbca.com/2020/03/Operating-System-Notes-BCA.html&quot;&gt;&lt;strong&gt;Operating System&lt;/strong&gt;&lt;/a&gt;: Q1.&lt;strong&gt;How Memory can dynamically allocated using First fit Best fit Worst fit strategies&lt;/strong&gt;? - with example. or&amp;nbsp; Explain 3 Allocation Algorithm with example? Q2.&lt;strong&gt;Dynamic Memory Allocation&lt;/strong&gt;? &lt;strong&gt;(&lt;a href=&quot;https://www.allbca.com/search/label/Operating-System&quot;&gt;Operating System all notes&lt;/a&gt;)&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7OCvZdwJA5U_B_eg5Vsq_2z2nh8gCYRHdN2iEtdvxR35NRwIe9Wrg7SbFj5WQDV-hqlmrwfVFhBkm5K7Of-1FcVX_sH1rFEB87hgik7uDmYQ8aGgN8_HIK54AAhRf3GiI-Nt48H990g/s1600/first-fit-best-fit-worst-fit-with-example-allocation-algorithm.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;first-fit-best-fit-worst-fit-with-example-allocation-algorithm&quot; border=&quot;0&quot; data-original-height=&quot;600&quot; data-original-width=&quot;800&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7OCvZdwJA5U_B_eg5Vsq_2z2nh8gCYRHdN2iEtdvxR35NRwIe9Wrg7SbFj5WQDV-hqlmrwfVFhBkm5K7Of-1FcVX_sH1rFEB87hgik7uDmYQ8aGgN8_HIK54AAhRf3GiI-Nt48H990g/s640/first-fit-best-fit-worst-fit-with-example-allocation-algorithm.webp&quot; title=&quot;first-fit-best-fit-worst-fit-with-example-allocation-algorithm&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q1. How Memory can dynamically allocated using ‘first fit’, ‘best fit’, ‘worst fit’ strategies? or Explain 3 Allocation Algorithm?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans.&lt;/strong&gt; The sets are an allocation algorithm to satisfy the dynamic shape allocation problem, which concerns how to satisfy a request of size from the list of free holes.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;(a) First-Fit:&lt;/strong&gt; Allocate the first hole that is big enough. Searching can start either at the beginning of the set of holes or where the previous first search ended. We can stop searching as soon as we find a free hole that is large enough.&lt;br /&gt;
&lt;strong&gt;(b) Best-Fit:&lt;/strong&gt; Allocate the smallest hole that is big enough. We must search the entire list unless the list is ordered by size.&lt;br /&gt;
&lt;strong&gt;(c) Worst-Fit:&lt;/strong&gt; Allocate the largest hole. We must search the entire list unless the list is ordered by size.&lt;br /&gt;
&lt;br /&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Hole&lt;/th&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Hole&lt;/th&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th style=&quot;transform: rotate(-90deg);&quot;&gt;Hole&lt;/th&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Hole&lt;/th&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Hole&lt;/th&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Hole&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;5k&lt;/td&gt;&lt;td&gt;10k&lt;/td&gt;&lt;td&gt;20k&lt;/td&gt;&lt;td&gt;30k&lt;/td&gt;&lt;td&gt;10k&lt;/td&gt;&lt;td&gt;5k&lt;/td&gt;&lt;td&gt;30k&lt;/td&gt;&lt;td&gt;20k&lt;/td&gt;&lt;td&gt;10k&lt;/td&gt;&lt;td&gt;15k&lt;/td&gt;&lt;td&gt;20k&lt;/td&gt;&lt;td&gt;20k&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;strong&gt;Fig. (a) Variable partition memory allocation.&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;
&lt;strong&gt;1.&lt;/strong&gt; Using first-fit if the request arrives in order 20k, 10k, then the memory allocation is for 20k according to above figure a is:&lt;br /&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Hole&lt;/th&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Free&lt;/th&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th style=&quot;transform: rotate(-90deg);&quot;&gt;Hole&lt;/th&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Hole&lt;/th&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Hole&lt;/th&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Hole&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;5k&lt;/td&gt;&lt;td&gt;10k&lt;/td&gt;&lt;td&gt;20k&lt;/td&gt;&lt;td&gt;20k&lt;/td&gt;&lt;td&gt;10k&lt;/td&gt;&lt;td&gt;10k&lt;/td&gt;&lt;td&gt;5k&lt;/td&gt;&lt;td&gt;30k&lt;/td&gt;&lt;td&gt;20k&lt;/td&gt;&lt;td&gt;10k&lt;/td&gt;&lt;td&gt;15k&lt;/td&gt;&lt;td&gt;20k&lt;/td&gt;&lt;td&gt;20k&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;strong&gt;Fig. (b)&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Memory allocation for 10k according to above figure (b) is:&lt;br /&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Hole&lt;/th&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Hole&lt;/th&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Hole&lt;/th&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Hole&lt;/th&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Hole&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;60k&lt;/td&gt;&lt;td&gt;10k&lt;/td&gt;&lt;td&gt;10k&lt;/td&gt;&lt;td&gt;5k&lt;/td&gt;&lt;td&gt;30k&lt;/td&gt;&lt;td&gt;20k&lt;/td&gt;&lt;td&gt;10k&lt;/td&gt;&lt;td&gt;15k&lt;/td&gt;&lt;td&gt;20k&lt;/td&gt;&lt;td&gt;20k&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;
&lt;strong&gt;2.&lt;/strong&gt; Using best-fit if the request arrives in order 20k, 10k, then memory allocation for 20k according to figure (a) is:&lt;br /&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Hole&lt;/th&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Hole&lt;/th&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Hole&lt;/th&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Hole&lt;/th&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Hole&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;60k&lt;/td&gt;&lt;td&gt;10k&lt;/td&gt;&lt;td&gt;10k&lt;/td&gt;&lt;td&gt;5k&lt;/td&gt;&lt;td&gt;30k&lt;/td&gt;&lt;td&gt;20k&lt;/td&gt;&lt;td&gt;10k&lt;/td&gt;&lt;td&gt;15k&lt;/td&gt;&lt;td&gt;20k&lt;/td&gt;&lt;td&gt;20k&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;strong&gt;Fig. (c)&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Memory allocation for 10k according to figure (c) is:&lt;br /&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Hole&lt;/th&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Hole&lt;/th&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Hole&lt;/th&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Hole&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;40k&lt;/td&gt;&lt;td&gt;30k&lt;/td&gt;&lt;td&gt;10k&lt;/td&gt;&lt;td&gt;5k&lt;/td&gt;&lt;td&gt;60k&lt;/td&gt;&lt;td&gt;15k&lt;/td&gt;&lt;td&gt;20k&lt;/td&gt;&lt;td&gt;20k&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;
&lt;strong&gt;3.&lt;/strong&gt; Using Worst-fit if the request arrives in order 20k, 10k, then memory allocation according to the figure for 20k according to figure (a) is:&lt;br /&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Hole&lt;/th&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Hole&lt;/th&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Hole&lt;/th&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Hole&lt;/th&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Hole&lt;/th&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Hole&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;10k&lt;/td&gt;&lt;td&gt;10k&lt;/td&gt;&lt;td&gt;40k&lt;/td&gt;&lt;td&gt;10k&lt;/td&gt;&lt;td&gt;10k&lt;/td&gt;&lt;td&gt;5k&lt;/td&gt;&lt;td&gt;30k&lt;/td&gt;&lt;td&gt;20k&lt;/td&gt;&lt;td&gt;10k&lt;/td&gt;&lt;td&gt;15k&lt;/td&gt;&lt;td&gt;20k&lt;/td&gt;&lt;td&gt;20k&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;strong&gt;Fig. (d)&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Memory allocation for 10k according to the figure (d) is:&lt;br /&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Hole&lt;/th&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Hole&lt;/th&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Hole&lt;/th&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Hole&lt;/th&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Hole&lt;/th&gt;&lt;th&gt;Used&lt;/th&gt;&lt;th&gt;Hole&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;10k&lt;/td&gt;&lt;td&gt;10k&lt;/td&gt;&lt;td&gt;40k&lt;/td&gt;&lt;td&gt;10k&lt;/td&gt;&lt;td&gt;10k&lt;/td&gt;&lt;td&gt;5k&lt;/td&gt;&lt;td&gt;40k&lt;/td&gt;&lt;td&gt;10k&lt;/td&gt;&lt;td&gt;10k&lt;/td&gt;&lt;td&gt;15k&lt;/td&gt;&lt;td&gt;20k&lt;/td&gt;&lt;td&gt;20k&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q2. Dynamic Memory Allocation?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans.&lt;/strong&gt; The disk can be viewed as a large array of blocks. At any given time, the source of these blocks is allocated to files and others are free. Disk space can be seen as a collection of free and used segments in which each segment is a contiguous set of disk blocks.&lt;br /&gt;
&lt;br /&gt;
A free segment &lt;em&gt;(or unallocated segment)&lt;/em&gt; is called a hole. The dynamic storage allocation problem is how to satisfy a request of &lt;em&gt;n-size&lt;/em&gt; from a list of free holes.&lt;br /&gt;
&lt;br /&gt;
There are many solutions to this problem. The set of the hole is searched to determine which hole is best to allocate. These three strategies&lt;em&gt;(which are in the 1st question)&lt;/em&gt; are the common strategies that are used to select a free hole from the set of available holes.&lt;br /&gt;
&lt;br /&gt;
These algorithms suffer from &lt;a href=&quot;https://www.allbca.com/2020/04/fragmentation-in-os.html&quot;&gt;external fragmentation&lt;/a&gt;. To prevent external fragmentation user must compact all free space into one hole.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: purple;&quot;&gt;External Links:-&lt;/span&gt;&lt;/h3&gt;
1. Allocation Algorithm - (&lt;a href=&quot;https://en.wikipedia.org/wiki/Buddy_memory_allocation&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
2.&amp;nbsp; Three Strategies - (&lt;a href=&quot;https://www.geeksforgeeks.org/first-fit-allocation-in-operating-systems/&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;[ Topic= Allocation Algorithm ]&lt;/span&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/1379486706229453999'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/1379486706229453999'/><link rel='alternate' type='text/html' href='https://www.allbca.com/2020/05/first-fit-best-fit-worst-fit-with-example-allocation-algorithm.html' title='First fit Best fit Worst fit with example | Allocation Algorithm'/><author><name>Mayank Rana</name><uri>http://www.blogger.com/profile/06163424302596650438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs9mOMQbRjoNrVnY7AbBycXEpeOG7szPXA2y_RbbeTVJ25GEGpq6q-gZxcoKqROoy4G51CI9ZCvXhjBXCUH8gb-MvrIfJnbBBdt4BY6sgH3zI2blMucgSoV-XQYw6d9g/s125/mayankrana.webp'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7OCvZdwJA5U_B_eg5Vsq_2z2nh8gCYRHdN2iEtdvxR35NRwIe9Wrg7SbFj5WQDV-hqlmrwfVFhBkm5K7Of-1FcVX_sH1rFEB87hgik7uDmYQ8aGgN8_HIK54AAhRf3GiI-Nt48H990g/s72-c/first-fit-best-fit-worst-fit-with-example-allocation-algorithm.webp" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5313576602653501716.post-241798848694150221</id><published>2020-04-30T00:43:00.000+05:30</published><updated>2020-04-30T01:11:57.518+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Operating-System"/><title type='text'>Disk Structure in Operating System - Diagram</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;a href=&quot;https://www.allbca.com/2020/03/Operating-System-Notes-BCA.html&quot;&gt;&lt;strong&gt;Operating System&lt;/strong&gt;&lt;/a&gt;: Q1.&lt;strong&gt;Disk Structure in Operating System&lt;/strong&gt;? Q2.&lt;strong&gt;What is CPU scheduling&lt;/strong&gt;? Q3.&lt;strong&gt;What is preemptive scheduling&lt;/strong&gt;? Q4.&lt;strong&gt;What is non-preemptive scheduling&lt;/strong&gt;? &lt;strong&gt;(&lt;a href=&quot;https://www.allbca.com/search/label/Operating-System&quot;&gt;Operating System all notes&lt;/a&gt;)&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMP0aaJw-Ug3ZWi9V12UDxPF-o-B2tuvWilHBGkwp5kAz1NwHfv4kG93lZSWnDwS5yWFFkeroEVID03gc88hjv2E3kXzMGv2KceOfPhrJRRlYjOZT4WLogkdACIjHybEFICKoSxtPqnw/s1600/Disk-Structure-in-Operating-System.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Disk-Structure-in-Operating-System&quot; border=&quot;0&quot; data-original-height=&quot;600&quot; data-original-width=&quot;800&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMP0aaJw-Ug3ZWi9V12UDxPF-o-B2tuvWilHBGkwp5kAz1NwHfv4kG93lZSWnDwS5yWFFkeroEVID03gc88hjv2E3kXzMGv2KceOfPhrJRRlYjOZT4WLogkdACIjHybEFICKoSxtPqnw/s640/Disk-Structure-in-Operating-System.webp&quot; title=&quot;Disk-Structure-in-Operating-System&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q1. Disk Structure in Operating System? with diagram?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans. Disk Structure in Operating System:&lt;/strong&gt; The actual physical details of a modern hard disk may be quite complicated. Simply, there are one or more surfaces, each of which contains several tracks, each of which is divided into sectors.&lt;br /&gt;
&lt;br /&gt;
There is one read/write head for every surface of the disk. Also, the same track on all surfaces is known as a &lt;strong&gt;cylinder&lt;/strong&gt;, When talking about movement of the read/write head, the cylinder is a useful concept, because all the heads &lt;em&gt;(one for each surface)&lt;/em&gt;, move in and out of the disk together.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAqYplbTbgg30Y6YTzSmhRA2tvnhnY89IeEbjqfD7hTZL7JTo5X_N2oqVAr3IsufCKsAZbOk0X85VcMCUIJh1PmUZYLN7PjgZEHrBhyphenhyphenfh1uD7xqrY94eXJxqmPgOmD-OTZrkaM4GP1_g/s1600/Disk-Structure-Diagram.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Disk-Structure-Diagram&quot; border=&quot;0&quot; data-original-height=&quot;414&quot; data-original-width=&quot;1600&quot; height=&quot;164&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAqYplbTbgg30Y6YTzSmhRA2tvnhnY89IeEbjqfD7hTZL7JTo5X_N2oqVAr3IsufCKsAZbOk0X85VcMCUIJh1PmUZYLN7PjgZEHrBhyphenhyphenfh1uD7xqrY94eXJxqmPgOmD-OTZrkaM4GP1_g/s640/Disk-Structure-Diagram.webp&quot; title=&quot;Disk-Structure-Diagram&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
We say that the “read/write head is at cylinder #2&quot;, when we mean that the top read/write head is at track #2 of the top surface, the next head is at track #2 of the next surface, the third head is at track #2 of the third surface, etc.&lt;br /&gt;
&lt;br /&gt;
The unit of information transfer is the sector &lt;em&gt;(though often whole tracks may be read and written, depending on the hardware)&lt;/em&gt;. As far as most file-systems are concerned, though, the sectors are what matter. In fact, we usually talk about a &#39;&lt;strong&gt;block device&lt;/strong&gt;&#39;. A block often corresponds to a sector, though it need not do, several sectors may be aggregated to form a single logical block.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q2. What is CPU scheduling?&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt; :Disk Structure&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans.&lt;/strong&gt; In a multiprogramming operating system, the method or procedure for switching the CPU among multiple processes is called CPU scheduling or process scheduling.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q3. What is preemptive scheduling?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans.&lt;/strong&gt; A scheduling discipline is preemptive if, once a process has been given to the CPU can take away. The strategy of allowing processes that are logically runnable to be temporarily suspended is called &lt;strong&gt;preemptive scheduling&lt;/strong&gt; and it is contrast to the “&lt;strong&gt;run to completion&lt;/strong&gt;&quot; method.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q4. What is non-preemptive scheduling?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans.&lt;/strong&gt; A scheduling discipline is non-preemptive if, once a process has been given to the CPU, the CPU cannot be taken away from that process.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;[ Topic= Disk Structure in Operating System&amp;nbsp;]&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Join us on Facebook, Instagram, and Twitter to get the latest study material. You can also ask us any questions.&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;Facebook =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;a href=&quot;https://www.fb.com/allbcaweb&quot; rel=&quot;nofollow&quot; style=&quot;color: blue;&quot;&gt;@allbcaweb&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Facebook)&lt;br /&gt;
&lt;b&gt;Instagram&lt;/b&gt; = &lt;a href=&quot;https://www.instagram.com/allbcaweb/&quot; rel=&quot;nofollow noopener noreferrer&quot; target=&quot;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;@allbcaweb&lt;/b&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Instagram)&lt;br /&gt;
&lt;strong&gt;Twitter =&amp;nbsp;&lt;span style=&quot;color: #00ccff;&quot;&gt;&lt;a href=&quot;https://www.twitter.com/allbcaweb&quot; rel=&quot;nofollow&quot; style=&quot;color: #00ccff;&quot;&gt;@allbcaweb&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Twitter)&lt;br /&gt;
&lt;b&gt;Email=&amp;nbsp;&lt;a href=&quot;mailto:allbca.com@gmail.com&quot;&gt;allbca.com@gmail.com&lt;/a&gt;&lt;br /&gt;Send us your query anytime about Disk Structure!&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: purple;&quot;&gt;External Links:-&lt;/span&gt;&lt;/h3&gt;
1. Disk Structure in Operating System&amp;nbsp;- (&lt;a href=&quot;https://www.slideshare.net/Shareb123/disk-structure-72295677&quot; target=&quot;_blank&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;[ Topic= Disk Structure in Operating System&amp;nbsp;]&lt;/b&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/241798848694150221'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/241798848694150221'/><link rel='alternate' type='text/html' href='https://www.allbca.com/2020/04/disk-structure-in-operating-system.html' title='Disk Structure in Operating System - Diagram'/><author><name>Mayank Rana</name><uri>http://www.blogger.com/profile/06163424302596650438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs9mOMQbRjoNrVnY7AbBycXEpeOG7szPXA2y_RbbeTVJ25GEGpq6q-gZxcoKqROoy4G51CI9ZCvXhjBXCUH8gb-MvrIfJnbBBdt4BY6sgH3zI2blMucgSoV-XQYw6d9g/s125/mayankrana.webp'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMP0aaJw-Ug3ZWi9V12UDxPF-o-B2tuvWilHBGkwp5kAz1NwHfv4kG93lZSWnDwS5yWFFkeroEVID03gc88hjv2E3kXzMGv2KceOfPhrJRRlYjOZT4WLogkdACIjHybEFICKoSxtPqnw/s72-c/Disk-Structure-in-Operating-System.webp" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5313576602653501716.post-7249105241414385300</id><published>2020-04-29T19:36:00.001+05:30</published><updated>2020-04-29T19:54:50.724+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Operating-System"/><title type='text'>Fragmentation in OS - internal and external fragmentation</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;a href=&quot;https://www.allbca.com/2020/03/Operating-System-Notes-BCA.html&quot;&gt;&lt;strong&gt;Operating System&lt;/strong&gt;&lt;/a&gt;: Q1.&lt;strong&gt;What is Fragmentation in OS&lt;/strong&gt;? Q2.&lt;strong&gt;What is Internal Fragmentation&lt;/strong&gt;? Q3.&lt;strong&gt;What is External Fragmentation&lt;/strong&gt;? &lt;strong&gt;(&lt;a href=&quot;https://www.allbca.com/search/label/Operating-System&quot;&gt;Operating System all notes&lt;/a&gt;)&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiITnD2Uv9hiQHdpwv7cjC2rcMSx45AFhL-0-0-w29TW0ge6YzuA-gx7a4_ThUC4nebY6YriEqSqGJRj8Da_FkVZGKXBOvO0LdXzqDlPklgWAjazlbOI8XDrlSYfY9Ns6VsFRJlT__QVg/s1600/Fragmentation-in-OS.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Fragmentation-in-OS&quot; border=&quot;0&quot; data-original-height=&quot;600&quot; data-original-width=&quot;800&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiITnD2Uv9hiQHdpwv7cjC2rcMSx45AFhL-0-0-w29TW0ge6YzuA-gx7a4_ThUC4nebY6YriEqSqGJRj8Da_FkVZGKXBOvO0LdXzqDlPklgWAjazlbOI8XDrlSYfY9Ns6VsFRJlT__QVg/s640/Fragmentation-in-OS.webp&quot; title=&quot;Fragmentation-in-OS&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q1. What is Fragmentation in OS?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans. Fragmentation in OS:&lt;/strong&gt; Fragmentation is a phenomenon in which storage space is used inefficiently, reducing capacity or performance and often both. It occurs in a dynamic memory allocation system when many of the free blocks are too small to satisfy any request.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;Fragmentation in OS is of 2 types:&lt;/span&gt;&lt;/h3&gt;
&lt;strong&gt;(i) External Fragmentation:&lt;/strong&gt; It happens when a dynamic memory allocation algorithm allocates some memory and a small piece is left over that cannot be effectively used.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;(ii) Internal Fragmentation:&lt;/strong&gt; It is the space wasted inside allocated memory blocks because of the restriction of the allowed sizes of allocated blocks.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q2. What is Internal Fragmentation? with example?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans. Internal Fragmentation:&lt;/strong&gt; Internal fragmentation occurs when the memory allocator leaves extra space empty inside of a block of memory that has been allocated for a client. This usually happens because the processor&#39;s design stipulates that memory must be cut into blocks of certain sizes.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;For example&lt;/strong&gt;, blocks may be required to be evenly be divided by four, eight, or 16 bytes. When this occurs, a client that needs 57 bytes of memory, for example, maybe allocated a block that contains 60 bytes, or even 64.&lt;br /&gt;
The extra bytes that the client doesn&#39;t need go to waste, and over time these tiny chunks of unused memory can build up and create large quantities of memory that can&#39;t be put to use by the allocator. Because all of these useless bytes are inside larger memory blocks, the fragmentation is considered internal.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q3. What is External Fragmentation? with example?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans. External Fragmentation:&lt;/strong&gt; External fragmentation happens when the memory allocator leaves sections of unused memory blocks between portions of allocated memory.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;For example&lt;/strong&gt;, if several memory blocks are allocated in a continuous line but one of the middle blocks in the line is freed (perhaps because the process that was using that block of memory stopped running), the free block is fragmented.&lt;br /&gt;
&lt;br /&gt;
The block is still available for use by the allocator later if there&#39;s a need for memory that fits in that block, but the block is now unusable for larger memory needs. It cannot be lumped back in with the total free memory available to the system, as total memory must be contiguous for it to be useable for larger tasks.&lt;br /&gt;
&lt;br /&gt;
In this way, entire sections of free memory can end up isolated from the whole that is often too small for significant use, which creates an overall reduction of free memory that over time can lead to a lack of available memory for key tasks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #f3f3f3;&quot;&gt;[ Topic= Fragmentation in OS ]&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;[ Topic= Fragmentation in OS ]&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: #f3f3f3;&quot;&gt;[ Topic= Fragmentation in OS ]&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Join us on Facebook, Instagram, and Twitter to get the latest study material. You can also ask us any questions.&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;Facebook =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;a href=&quot;https://www.fb.com/allbcaweb&quot; rel=&quot;nofollow&quot; style=&quot;color: blue;&quot;&gt;@allbcaweb&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Facebook)&lt;br /&gt;
&lt;b&gt;Instagram&lt;/b&gt; = &lt;a href=&quot;https://www.instagram.com/allbcaweb/&quot; rel=&quot;nofollow noopener noreferrer&quot; target=&quot;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;@allbcaweb&lt;/b&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Instagram)&lt;br /&gt;
&lt;strong&gt;Twitter =&amp;nbsp;&lt;span style=&quot;color: #00ccff;&quot;&gt;&lt;a href=&quot;https://www.twitter.com/allbcaweb&quot; rel=&quot;nofollow&quot; style=&quot;color: #00ccff;&quot;&gt;@allbcaweb&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Twitter)&lt;br /&gt;
&lt;b&gt;Email=&amp;nbsp;&lt;a href=&quot;mailto:allbca.com@gmail.com&quot;&gt;allbca.com@gmail.com&lt;/a&gt;&lt;br /&gt;Send us your query anytime about Fragmentation in OS!&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: purple;&quot;&gt;External Links:-&lt;/span&gt;&lt;/h3&gt;
1. Fragmentation in OS - (&lt;a href=&quot;https://www.geeksforgeeks.org/difference-between-internal-and-external-fragmentation/&quot; target=&quot;_blank&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #f3f3f3;&quot;&gt;[ Topic= Fragmentation in OS ]&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;[ Topic= Fragmentation in OS ]&lt;/b&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/7249105241414385300'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/7249105241414385300'/><link rel='alternate' type='text/html' href='https://www.allbca.com/2020/04/fragmentation-in-os.html' title='Fragmentation in OS - internal and external fragmentation'/><author><name>Mayank Rana</name><uri>http://www.blogger.com/profile/06163424302596650438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs9mOMQbRjoNrVnY7AbBycXEpeOG7szPXA2y_RbbeTVJ25GEGpq6q-gZxcoKqROoy4G51CI9ZCvXhjBXCUH8gb-MvrIfJnbBBdt4BY6sgH3zI2blMucgSoV-XQYw6d9g/s125/mayankrana.webp'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiITnD2Uv9hiQHdpwv7cjC2rcMSx45AFhL-0-0-w29TW0ge6YzuA-gx7a4_ThUC4nebY6YriEqSqGJRj8Da_FkVZGKXBOvO0LdXzqDlPklgWAjazlbOI8XDrlSYfY9Ns6VsFRJlT__QVg/s72-c/Fragmentation-in-OS.webp" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5313576602653501716.post-5735598348328116923</id><published>2020-04-28T17:28:00.000+05:30</published><updated>2020-04-28T17:55:14.995+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Operating-System"/><title type='text'>Segmentation in OS - How is it different from Paging</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;a href=&quot;https://www.allbca.com/2020/03/Operating-System-Notes-BCA.html&quot;&gt;&lt;strong&gt;Operating System&lt;/strong&gt;&lt;/a&gt;: Q1.&lt;strong&gt;Memory Segmentation in OS&lt;/strong&gt;? - How is it different from Paging? or &lt;strong&gt;Paging and Segmentation in OS&lt;/strong&gt;? &lt;strong&gt;(&lt;a href=&quot;https://www.allbca.com/search/label/Operating-System&quot;&gt;Operating System all notes&lt;/a&gt;)&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjF_kYgbOM_B5I3jMKyyx9UgHg8EatEKtNoShA5B6Md_JF4usz3V060EijeMgbtoNX8IiIQQ2EyPqSOXhRzAZr3nV9grH7lmM2bQi5LuKHr6hy_gVgKCwfu5Si3HJDOWX-VOezW-jlRxQ/s1600/Segmentation-in-OS.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Segmentation-in-OS&quot; border=&quot;0&quot; data-original-height=&quot;600&quot; data-original-width=&quot;800&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjF_kYgbOM_B5I3jMKyyx9UgHg8EatEKtNoShA5B6Md_JF4usz3V060EijeMgbtoNX8IiIQQ2EyPqSOXhRzAZr3nV9grH7lmM2bQi5LuKHr6hy_gVgKCwfu5Si3HJDOWX-VOezW-jlRxQ/s640/Segmentation-in-OS.webp&quot; title=&quot;Segmentation-in-OS&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q1. What is Memory Segmentation in OS? How is it different from Paging?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans. Memory Segmentation:&lt;/strong&gt; Memory segmentation is a technique of non-contiguous memory allocation. In segmentation, the logical memory space is divided into certain unequal size chunks known as segments. According to segmentation, an application is loaded into memory as a collection of modules. In other words, the logically related instructions and data items are grouped and loaded into a segment.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;For Example:&lt;/strong&gt; An application can consist of five modules: the main program, function A, function B, the stack for storing data when a function is called, and shared data for all the modules such as global variables. Each module is loaded in a distinct segment in the main memory.&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: white;&quot;&gt;[ Topic= Paging and&amp;nbsp;Segmentation in OS ]&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;Accessing Addresses in Segmentation:&lt;/span&gt;&lt;/h3&gt;
In a segmented memory, a logical address consists of two parts: Segment number and offset. An &lt;strong&gt;offset&lt;/strong&gt; is the location within a segment, where any particular data is stored. e.g., : The logical address 3:10,000 indicates offset 10,000 and segment number 3.&lt;br /&gt;
A segment table, which has two fields: the &lt;em&gt;base address&lt;/em&gt; of the segment and the &lt;em&gt;size&lt;/em&gt; of the segment, is used for validation of an address. The base address of a segment is the location of a particular segment in the main memory, from where the segment starts.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxMS-xYPQCXEz-ZnWBOWnDRypChqZfg8IHkZwKXjhTA-dKTQx8Jqs7tZmgKCZaJ1WNgcxwak4wbJtUc-0jci6dwwhcQ1CBmme5yckWiXMrgSUIhhQsastdN1Xk3EKhx6ETSUyMpj4S0g/s1600/Segments-and-Segment-Table-in-OS-Diagram.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Segments-and-Segment-Table-in-OS-Diagram&quot; border=&quot;0&quot; data-original-height=&quot;759&quot; data-original-width=&quot;1600&quot; height=&quot;302&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxMS-xYPQCXEz-ZnWBOWnDRypChqZfg8IHkZwKXjhTA-dKTQx8Jqs7tZmgKCZaJ1WNgcxwak4wbJtUc-0jci6dwwhcQ1CBmme5yckWiXMrgSUIhhQsastdN1Xk3EKhx6ETSUyMpj4S0g/s640/Segments-and-Segment-Table-in-OS-Diagram.webp&quot; title=&quot;Segments-and-Segment-Table-in-OS-Diagram&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
This elaborates various memory segments in the main memory and their corresponding entries in the segment table. The segments need not to be loaded sequentially. e.g., : Segment 2 has been loaded in a lower position in the memory than in segment 0. The starting address and size of segments are stored in the segment table.&lt;br /&gt;
&lt;strong&gt;For example&lt;/strong&gt;, the base or starting address of the segment 2 is 60,000 and size of segment 2 is 15,000 bytes.&lt;br /&gt;
&lt;br /&gt;
When accessing an address in a segmented memory, the segment table is used for validation The logical address 2:12,000 indicates the location 12,000 starting from the base of the segment 2. The segment to start from the location 60,000 and its size is 15,000 bytes.&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: white;&quot;&gt;[ Topic= Paging and&amp;nbsp;Segmentation in OS ]&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;Segmentation with Paging:&lt;/span&gt;&lt;span style=&quot;background-color: white; color: white;&quot;&gt; Paging and&amp;nbsp;Segmentation in OS&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
Segmentation of memory can be implemented with a paging scheme. The unequal size segment can be represented by equal size pages. e.g. In a logical address space of 64 KB there are 32 pages of 2 KB each. A program is divided into 3 segments of the size 15 KB. 18 KB. 10 KB. These three segments require 8, 9, and 5 pages respectively to be loaded into the memory.&lt;br /&gt;
&lt;br /&gt;
The first segment occupies the memory space of 8 pages of 2 KB each or 18 KB each, whereas it&#39;s requirement is 15 KB memory space. Thus, an internal fragmentation of 1 KB occurs.&lt;br /&gt;
&lt;br /&gt;
In segmentation with a paging scheme two tables are used: &lt;em&gt;a segment table&lt;/em&gt; and &lt;em&gt;a page table&lt;/em&gt;. The segment table has two fields : &lt;em&gt;base address&lt;/em&gt; and &lt;em&gt;size&lt;/em&gt;. The base address of a segment is the address of the first page in the segment.&lt;br /&gt;
The &lt;strong&gt;size&lt;/strong&gt; of the segment is the number of pages a segment occupies. The &lt;strong&gt;page&lt;/strong&gt; table stores the address of a frame where a page is loaded into the memory.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;For example:&lt;/strong&gt; Value of the 15th cell of page table is 38,000. This mean that page 15 has been loaded into the frame located at the address 38,000 in the main memory.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi3eFVCIGCIANtiEadzi3Gaw0CL3WZ6CLCZ7YMGX0uFXX5Fv-ryyQKfPME2hthNAVoCioUJzdYip7hCfy_wYy_g88Dh_-oBY5_BzPv1cUoP8zQZ__apDB7eEd7-FQgKYUu_5qbYx7OUA/s1600/Paging-and-Segmentation-in-OS-Diagram.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Paging-and-Segmentation-in-OS-Diagram&quot; border=&quot;0&quot; data-original-height=&quot;1079&quot; data-original-width=&quot;1600&quot; height=&quot;430&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi3eFVCIGCIANtiEadzi3Gaw0CL3WZ6CLCZ7YMGX0uFXX5Fv-ryyQKfPME2hthNAVoCioUJzdYip7hCfy_wYy_g88Dh_-oBY5_BzPv1cUoP8zQZ__apDB7eEd7-FQgKYUu_5qbYx7OUA/s640/Paging-and-Segmentation-in-OS-Diagram.webp&quot; title=&quot;Paging-and-Segmentation-in-OS-Diagram&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: white;&quot;&gt;[ Topic= Paging and&amp;nbsp;Segmentation in OS ]&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;[ Topic= Paging and&amp;nbsp;Segmentation in OS ]&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: white;&quot;&gt;[ Topic= Paging and&amp;nbsp;Segmentation in OS ]&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Join us on Facebook, Instagram, and Twitter to get the latest study material. You can also ask us any questions.&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;Facebook =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;a href=&quot;https://www.fb.com/allbcaweb&quot; rel=&quot;nofollow&quot; style=&quot;color: blue;&quot;&gt;@allbcaweb&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Facebook)&lt;br /&gt;
&lt;b&gt;Instagram&lt;/b&gt; = &lt;a href=&quot;https://www.instagram.com/allbcaweb/&quot; rel=&quot;nofollow noopener noreferrer&quot; target=&quot;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;@allbcaweb&lt;/b&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Instagram)&lt;br /&gt;
&lt;strong&gt;Twitter =&amp;nbsp;&lt;span style=&quot;color: #00ccff;&quot;&gt;&lt;a href=&quot;https://www.twitter.com/allbcaweb&quot; rel=&quot;nofollow&quot; style=&quot;color: #00ccff;&quot;&gt;@allbcaweb&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Twitter)&lt;br /&gt;
&lt;b&gt;Email=&amp;nbsp;&lt;a href=&quot;mailto:allbca.com@gmail.com&quot;&gt;allbca.com@gmail.com&lt;/a&gt;&lt;br /&gt;Send us your query anytime about Paging and&amp;nbsp;Segmentation in OS!&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: #993366;&quot;&gt;External Links:-&lt;/span&gt;&lt;/h3&gt;
1. Segmentation in OS - (&lt;a href=&quot;https://en.wikipedia.org/wiki/Memory_segmentation&quot; target=&quot;_blank&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
2. Paging and&amp;nbsp;Segmentation in OS - (&lt;a href=&quot;https://www.tutorialspoint.com/difference-between-paging-and-segmentation&quot; target=&quot;_blank&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: white;&quot;&gt;[ Topic= Paging and&amp;nbsp;Segmentation in OS ]&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;[ Topic= Paging and Segmentation in OS ]&lt;/b&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/5735598348328116923'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/5735598348328116923'/><link rel='alternate' type='text/html' href='https://www.allbca.com/2020/04/paging-and-segmentation-in-os.html' title='Segmentation in OS - How is it different from Paging'/><author><name>Mayank Rana</name><uri>http://www.blogger.com/profile/06163424302596650438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs9mOMQbRjoNrVnY7AbBycXEpeOG7szPXA2y_RbbeTVJ25GEGpq6q-gZxcoKqROoy4G51CI9ZCvXhjBXCUH8gb-MvrIfJnbBBdt4BY6sgH3zI2blMucgSoV-XQYw6d9g/s125/mayankrana.webp'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjF_kYgbOM_B5I3jMKyyx9UgHg8EatEKtNoShA5B6Md_JF4usz3V060EijeMgbtoNX8IiIQQ2EyPqSOXhRzAZr3nV9grH7lmM2bQi5LuKHr6hy_gVgKCwfu5Si3HJDOWX-VOezW-jlRxQ/s72-c/Segmentation-in-OS.webp" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5313576602653501716.post-2318235949810668019</id><published>2020-04-28T11:19:00.002+05:30</published><updated>2020-04-28T11:43:32.332+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Operating-System"/><title type='text'>What is Semaphore in OS - dining philosophers problem</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;a href=&quot;https://www.allbca.com/2020/03/Operating-System-Notes-BCA.html&quot;&gt;&lt;strong&gt;Operating System&lt;/strong&gt;&lt;/a&gt;: Q1.&lt;strong&gt;What is Semaphore in OS&lt;/strong&gt;? Q2.&lt;strong&gt;Explain classic problems of Synchronization&lt;/strong&gt;? Or How can Semaphore be used to enforce &lt;strong&gt;mutual exclusion&lt;/strong&gt;? &lt;strong&gt;Dining philosophers problem&lt;/strong&gt;? &lt;strong&gt;(&lt;a href=&quot;https://www.allbca.com/search/label/Operating-System&quot;&gt;Operating System all notes&lt;/a&gt;)&lt;/strong&gt; &lt;span style=&quot;color: #f3f3f3;&quot;&gt;[ Topic= What is Semaphore in OS ]&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjARojLbY70R0wQ2NBsh9KcQoTLaGShEaz03DCac_1qoMV_0z6t4gNo71bDfm2QRBdciEeBf2xKNMURVfHRI0S15PYMsIL_n7UeETGq5W84HdM8kyiv5DlZg8urYHYJ96pFcfm2fLXLnw/s1600/What-is-Semaphore-in-OS.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;What-is-Semaphore-in-OS&quot; border=&quot;0&quot; data-original-height=&quot;600&quot; data-original-width=&quot;800&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjARojLbY70R0wQ2NBsh9KcQoTLaGShEaz03DCac_1qoMV_0z6t4gNo71bDfm2QRBdciEeBf2xKNMURVfHRI0S15PYMsIL_n7UeETGq5W84HdM8kyiv5DlZg8urYHYJ96pFcfm2fLXLnw/s640/What-is-Semaphore-in-OS.webp&quot; title=&quot;What-is-Semaphore-in-OS&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q1. What is Semaphore in OS?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans.&lt;/strong&gt; A semaphore is a variable. There are two types of semaphores:&lt;br /&gt;
&lt;strong&gt;(a)&lt;/strong&gt; Binary semaphores.&lt;br /&gt;
&lt;strong&gt;(b)&lt;/strong&gt; Counting semaphores.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Binary semaphore&lt;/strong&gt; has two methods associated with it (up, down/lock, unlock). Binary semaphorès can take only 2 values (0/1). They are used to acquire locks. When a resource is available, the process in charge set the semaphore to 1 else 0.&lt;br /&gt;
&lt;strong&gt;Counting semaphore&lt;/strong&gt; may have value to be greater than one, typically used to allocate resources from a pool of identical resources.&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;[ Topic= What is Semaphore in OS ]&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;[ Topic= What is Semaphore in OS ]&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;[ Topic= What is Semaphore in OS ]&lt;/span&gt;&lt;br /&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q2. Explain classic problems of Synchronization? Or How can a Semaphore be used to enforce mutual exclusion? Dining philosophers problem?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans. Semaphore in OS&lt;/strong&gt;&amp;nbsp;is used to solve the critical section problem. A semaphore (s) is an integer value. Semaphore is a variable that has an integer value upon which the following three operations are defined :&lt;br /&gt;
&lt;strong&gt;1.&lt;/strong&gt; A semaphore may be initialized to a non-negative value.&lt;br /&gt;
&lt;strong&gt;2.&lt;/strong&gt; The wait operation decrements the semaphore value. If the value becomes negative, then the process of executing the wait is blocked.&lt;br /&gt;
&lt;strong&gt;3.&lt;/strong&gt; The signal operation increments the semaphore value. If the value is not positive, then a process blocked by a wait operation is unblocked.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&lt;strong&gt;Pseudo Code for Wait&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
Wait (s)&lt;br /&gt;
{&lt;br /&gt;
While (S ≤ 0)&lt;br /&gt;
S = S - 1&lt;br /&gt;
}&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&lt;strong&gt;Pseudo Code for Signal&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
Signal (s)&lt;br /&gt;
{&lt;br /&gt;
S = S + 1&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Semaphores&lt;/strong&gt; are executed atomically. There is no guarantee that no two processes can execute wait and signal operations on the same semaphore at the same time. This situation is a critical section problem and can be solved in either of two ways.&lt;br /&gt;
&lt;br /&gt;
A &lt;strong&gt;binary semaphore&lt;/strong&gt; is a semaphore with an integer value that can range only between 0 and 1. In principle, it should be easier to implement the binary semaphore. In this, the queue is used to hold processes waiting on the semaphore. The process that has been blocked the longest is released from the queue.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Semaphores are not provided by hardware. But they have several attractive properties:&lt;/b&gt;&lt;br /&gt;
&lt;strong&gt;1.&lt;/strong&gt; Semaphores are machine-independent.&lt;br /&gt;
&lt;strong&gt;2.&lt;/strong&gt; Semaphores are simple to implement.&lt;br /&gt;
&lt;strong&gt;3.&lt;/strong&gt; Correctness is easy to determine.&lt;br /&gt;
&lt;strong&gt;4.&lt;/strong&gt; Can have many different critical sections with different semaphores.&lt;br /&gt;
&lt;strong&gt;5.&lt;/strong&gt; Semaphore acquire many resources simultaneously.&lt;br /&gt;
&lt;br /&gt;
To implement semaphores under this definition, the semaphore is defined as a type of the struct&lt;br /&gt;
{&lt;br /&gt;
int value;&lt;br /&gt;
struct process * list;&lt;br /&gt;
} semaphore;&lt;br /&gt;
The wait () operation can now be defined as:&lt;br /&gt;
wait (semaphore * s)&lt;br /&gt;
{&lt;br /&gt;
s → value --;&lt;br /&gt;
if (s → value &amp;lt; 0) {&lt;br /&gt;
add this process to s → list;&lt;br /&gt;
block [];&lt;br /&gt;
}&lt;br /&gt;
• The signal () semaphore operation can now be defined as&lt;br /&gt;
signal (semaphore *s) {&lt;br /&gt;
S → value + +;&lt;br /&gt;
if (s → value &amp;lt; = 0) {&lt;br /&gt;
remove a process P from s → list;&lt;br /&gt;
wakeup (P);&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: white;&quot;&gt;[ Topic= What is Semaphore in OS ]&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;1. The Bounded-Buffer Problem:&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt; (What is Semaphore in OS)&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
This is a generalization of the producer-consumer problem wherein access is controlled to a shared group of buffers of a limited size.&lt;br /&gt;
&lt;br /&gt;
In this solution, the two counting semaphores &quot;full&quot; and &quot;empty&quot; keep track of the current number of full and empty buffers respectively (and initialized to 0 and N respectively.) The binary semaphore mutex controls access to the critical section. The producer and consumer processes are nearly identical. One can think of the producer as producing full buffers and the consumer producing empty buffers.&lt;br /&gt;
Do {&lt;br /&gt;
.......&lt;br /&gt;
//produce an item in nextp&lt;br /&gt;
Wait (empty);&lt;br /&gt;
Wait (mutex);&lt;br /&gt;
.......&lt;br /&gt;
//add nextp to buffer&lt;br /&gt;
.......&lt;br /&gt;
Signal (mutex);&lt;br /&gt;
Signal(full);&lt;br /&gt;
} while (TRUE);&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&lt;strong&gt;The structure of the producer process&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
Do {&lt;br /&gt;
Wait (full);&lt;br /&gt;
Wait (mutex);&lt;br /&gt;
.......&lt;br /&gt;
//Remove an item from buffer to nextc&lt;br /&gt;
.......&lt;br /&gt;
Signal (mutex);&lt;br /&gt;
Signal (empty);&lt;br /&gt;
.......&lt;br /&gt;
//consume the item in nextc&lt;br /&gt;
.......&lt;br /&gt;
} while (TRUE);&lt;br /&gt;
&lt;strong&gt;The structure of the consumer process&lt;/strong&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;b&gt;[ Topic= What is Semaphore in OS ]&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;2.The Readers-Writers Problem:&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt; (What is Semaphore in OS)&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
In the readers-writers problem, there are some processes &lt;em&gt;(termed readers)&lt;/em&gt; who only read the shared data, and never change it, and there are other processes &lt;em&gt;(termed writers)&lt;/em&gt; who may change the data in addition to or instead of reading it.&lt;br /&gt;
&lt;br /&gt;
There is no limit to how many readers can access the data simultaneously, but when a writer accesses the data, it needs exclusive access. There are several variations to the readers-writers problem, most centered around relative priorities of readers versus writers.&lt;br /&gt;
&lt;h4&gt;
&lt;span style=&quot;color: #003300;&quot;&gt;(i) The First Readers :&lt;/span&gt;&lt;/h4&gt;
Writers problem gives priority to readers. In this problem, if a reader wants access to the data and there is not already a writer accessing it, then access is granted to the reader. A solution to this problem can lead to starvation of the writers, as there could always be more readers coming along to access the data.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;(A steady stream of readers will jump ahead of waiting writers as long as there is currently already another reader accessing the data because the writer is forced to wait until the data is idle, which may never happen if there are enough readers.)&lt;/i&gt;&lt;br /&gt;
&lt;h4&gt;
&lt;span style=&quot;color: #003300;&quot;&gt;(ii) The Second Readers:&lt;/span&gt;&lt;/h4&gt;
Writers problem gives priority to the writers. In this problem, when a writer wants access to the data it jumps to the head of the queue. All waiting readers are blocked, and the writer gets access to the data as soon as it becomes available. In this solution, the readers may be starved by a steady stream of writers.&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: white;&quot;&gt;[ Topic= What is Semaphore in OS ]&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;3. The Dining Philosophers Problem: &lt;/span&gt;&lt;/h3&gt;
The dining philosophers problem is a classic synchronization problem involving the allocation of limited resources amongst a group of processes in a deadlock-free and starvation-free manner:&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;(a)&lt;/strong&gt; Consider five philosophers sitting around a table, in which there are five chopsticks evenly distributed and an endless bowl of rice in the center, as shown in the diagram. &lt;em&gt;(There is exactly one chopstick between each pair of dining philosophers.)&lt;/em&gt;&lt;br /&gt;
&lt;strong&gt;(b)&lt;/strong&gt; These philosophers spend their lives alternating between two activities: eating and thinking.&lt;br /&gt;
&lt;strong&gt;(c)&lt;/strong&gt; When it is time for a philosopher to eat, it must first acquire two chopsticks - one from their left and one from their right.&lt;br /&gt;
&lt;strong&gt;(d)&lt;/strong&gt; When a philosopher thinks, it puts down both chopsticks in their original locations.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvJ-OGlcAon8i7JNdigU1b4rMXfT26eXKEr7NrFfvpPhE6u_B-bggoQ2Bdp3EjdsGNldCn61QpfeJalzh-yZS_vMDYz5uEWHlGi0Lo7sKhfoKJA6wRR6X2MRifEKslazNzJKxvF9dMOg/s1600/Dining-Philosophers-Diagram.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Dining-Philosophers-Diagram&quot; border=&quot;0&quot; data-original-height=&quot;846&quot; data-original-width=&quot;1600&quot; height=&quot;338&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvJ-OGlcAon8i7JNdigU1b4rMXfT26eXKEr7NrFfvpPhE6u_B-bggoQ2Bdp3EjdsGNldCn61QpfeJalzh-yZS_vMDYz5uEWHlGi0Lo7sKhfoKJA6wRR6X2MRifEKslazNzJKxvF9dMOg/s640/Dining-Philosophers-Diagram.webp&quot; title=&quot;Dining-Philosophers-Diagram&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: white;&quot;&gt;[ Topic= What is Semaphore in OS ]&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;[ Topic= What is Semaphore in OS ]&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: white;&quot;&gt;[ Topic= What is Semaphore in OS ]&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Join us on Facebook, Instagram, and Twitter to get the latest study material. You can also ask us any questions.&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;Facebook =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;a href=&quot;https://www.fb.com/allbcaweb&quot; rel=&quot;nofollow&quot; style=&quot;color: blue;&quot;&gt;@allbcaweb&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Facebook)&lt;br /&gt;
&lt;b&gt;Instagram&lt;/b&gt; = &lt;a href=&quot;https://www.instagram.com/allbcaweb/&quot; rel=&quot;nofollow noopener noreferrer&quot; target=&quot;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;@allbcaweb&lt;/b&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Instagram)&lt;br /&gt;
&lt;strong&gt;Twitter =&amp;nbsp;&lt;span style=&quot;color: #00ccff;&quot;&gt;&lt;a href=&quot;https://www.twitter.com/allbcaweb&quot; rel=&quot;nofollow&quot; style=&quot;color: #00ccff;&quot;&gt;@allbcaweb&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Twitter)&lt;br /&gt;
&lt;b&gt;Email=&amp;nbsp;&lt;a href=&quot;mailto:allbca.com@gmail.com&quot;&gt;allbca.com@gmail.com&lt;/a&gt;&lt;br /&gt;Send us your query anytime about Semaphore in OS!&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;[ Topic= What is Semaphore in OS ]&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: #993366;&quot;&gt;External Links:-&lt;/span&gt;&lt;/h3&gt;
1. What is Semaphore in OS - (&lt;a href=&quot;https://en.wikipedia.org/wiki/Semaphore_(programming)&quot; target=&quot;_blank&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
2. What is Semaphore in OS - (&lt;a href=&quot;https://www.geeksforgeeks.org/semaphores-in-process-synchronization/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: white;&quot;&gt;[ Topic= What is Semaphore in OS ]&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;[ Topic= What is Semaphore in OS ]&lt;/b&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/2318235949810668019'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/2318235949810668019'/><link rel='alternate' type='text/html' href='https://www.allbca.com/2020/04/what-is-semaphore-in-os.html' title='What is Semaphore in OS - dining philosophers problem'/><author><name>Mayank Rana</name><uri>http://www.blogger.com/profile/06163424302596650438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs9mOMQbRjoNrVnY7AbBycXEpeOG7szPXA2y_RbbeTVJ25GEGpq6q-gZxcoKqROoy4G51CI9ZCvXhjBXCUH8gb-MvrIfJnbBBdt4BY6sgH3zI2blMucgSoV-XQYw6d9g/s125/mayankrana.webp'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjARojLbY70R0wQ2NBsh9KcQoTLaGShEaz03DCac_1qoMV_0z6t4gNo71bDfm2QRBdciEeBf2xKNMURVfHRI0S15PYMsIL_n7UeETGq5W84HdM8kyiv5DlZg8urYHYJ96pFcfm2fLXLnw/s72-c/What-is-Semaphore-in-OS.webp" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5313576602653501716.post-2998632322088561564</id><published>2020-04-27T21:34:00.001+05:30</published><updated>2020-04-27T21:50:31.603+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Operating-System"/><title type='text'>Thrashing in OS - Causes of thrashing in os</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;a href=&quot;https://www.allbca.com/2020/03/Operating-System-Notes-BCA.html&quot;&gt;&lt;strong&gt;Operating System&lt;/strong&gt;&lt;/a&gt;: Q1.&lt;strong&gt;Thrashing in OS&lt;/strong&gt;? - Causes of thrashing in OS. &lt;strong&gt;(&lt;a href=&quot;https://www.allbca.com/search/label/Operating-System&quot;&gt;Operating System all notes&lt;/a&gt;)&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJ5bf6805iRgRYO2eJ5iC8Rzr1MdAU636RxU9sMLqcnIsNtqT0qF08InVQRgJmdN3_eTc5qL1SfLrDjDGlGjTkibS8nMeNtAT3ClRYg0qIDArEHz5MbM3tRXtfL8F6pS9MCn9Lu263MQ/s1600/Thrashing-in-OS.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Thrashing-in-OS&quot; border=&quot;0&quot; data-original-height=&quot;600&quot; data-original-width=&quot;800&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJ5bf6805iRgRYO2eJ5iC8Rzr1MdAU636RxU9sMLqcnIsNtqT0qF08InVQRgJmdN3_eTc5qL1SfLrDjDGlGjTkibS8nMeNtAT3ClRYg0qIDArEHz5MbM3tRXtfL8F6pS9MCn9Lu263MQ/s640/Thrashing-in-OS.webp&quot; title=&quot;Thrashing-in-OS&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q1. Thrashing in OS? How can we use this in the operating system?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans. Thrashing in OS:&lt;/strong&gt; If the number of frames allocated a low priority process, falls below the minimum number of frames required by the computer instructions, we must suspend its execution. We should then page out its remaining pages, freeing all of its allocated frames. This procedure introduces a swap in slash.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYnOSnub1uMTPntYp-UUwKJPw20BUFLklVNoLSBQn0iuEXKzR1ivr2jFVovaimtT5KiDBSF7HOZcyu9xagAJIEn6Ou3gbdby0j7eBMLbfMaGRbRtlrY2H5mK3HVMQggh9pD-sqvczMoA/s1600/Thrashing-in-OS-Diagram.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Thrashing-in-OS-Diagram&quot; border=&quot;0&quot; data-original-height=&quot;551&quot; data-original-width=&quot;1600&quot; height=&quot;220&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYnOSnub1uMTPntYp-UUwKJPw20BUFLklVNoLSBQn0iuEXKzR1ivr2jFVovaimtT5KiDBSF7HOZcyu9xagAJIEn6Ou3gbdby0j7eBMLbfMaGRbRtlrY2H5mK3HVMQggh9pD-sqvczMoA/s640/Thrashing-in-OS-Diagram.webp&quot; title=&quot;Thrashing-in-OS-Diagram&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
In fact, look at any process which does not have enough frames. Although it is technically possible to reduce the number of frames to a minimum, there is some larger number of pages that are inactively in use of the process, does not have this number of frames, it will very quickly page fault at this point, it must replace some pages.&lt;br /&gt;
&lt;br /&gt;
However, since all of its pages are of inductive use, we must replace a page which will be needed again right away.&lt;br /&gt;
&lt;br /&gt;
Consequently, it very quickly faults again and again. The program continues to a fault, replacing pages for which it will then fault and bring back in right away.&lt;br /&gt;
&lt;br /&gt;
This very high paging activity is called thrashing. A process of thrashing is spending more time paging than executing. Thrashing can cause several performance problems.&lt;br /&gt;
&lt;br /&gt;
Thrashing is the coincidence of high page traffic and low CPU utilization. When a process is executing in high page fault area and not utilizing CPU then this condition is called thrashing.&lt;br /&gt;
Thrashing is a problem because thrashing consumes a lot of computer energy but accomplishes very little useful results.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Join us on Facebook, Instagram, and Twitter to get the latest study material. You can also ask us any questions.&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;Facebook =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;a href=&quot;https://www.fb.com/allbcaweb&quot; rel=&quot;nofollow&quot; style=&quot;color: blue;&quot;&gt;@allbcaweb&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Facebook)&lt;br /&gt;
&lt;b&gt;Instagram&lt;/b&gt; = &lt;a href=&quot;https://www.instagram.com/allbcaweb/&quot; rel=&quot;nofollow noopener noreferrer&quot; target=&quot;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;@allbcaweb&lt;/b&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Instagram)&lt;br /&gt;
&lt;strong&gt;Twitter =&amp;nbsp;&lt;span style=&quot;color: #00ccff;&quot;&gt;&lt;a href=&quot;https://www.twitter.com/allbcaweb&quot; rel=&quot;nofollow&quot; style=&quot;color: #00ccff;&quot;&gt;@allbcaweb&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Twitter)&lt;br /&gt;
&lt;b&gt;Email=&amp;nbsp;&lt;a href=&quot;mailto:allbca.com@gmail.com&quot;&gt;allbca.com@gmail.com&lt;/a&gt;&lt;br /&gt;Send us your query anytime about Thrashing in OS!&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: #993366;&quot;&gt;External Links:-&lt;/span&gt;&lt;/h3&gt;
1. Thrashing in OS - (&lt;a href=&quot;https://practice.geeksforgeeks.org/problems/thrashing-in-os&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;[ Topic= Thrashing in OS ]&lt;/b&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/2998632322088561564'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/2998632322088561564'/><link rel='alternate' type='text/html' href='https://www.allbca.com/2020/04/thrashing-in-os.html' title='Thrashing in OS - Causes of thrashing in os'/><author><name>Mayank Rana</name><uri>http://www.blogger.com/profile/06163424302596650438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs9mOMQbRjoNrVnY7AbBycXEpeOG7szPXA2y_RbbeTVJ25GEGpq6q-gZxcoKqROoy4G51CI9ZCvXhjBXCUH8gb-MvrIfJnbBBdt4BY6sgH3zI2blMucgSoV-XQYw6d9g/s125/mayankrana.webp'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJ5bf6805iRgRYO2eJ5iC8Rzr1MdAU636RxU9sMLqcnIsNtqT0qF08InVQRgJmdN3_eTc5qL1SfLrDjDGlGjTkibS8nMeNtAT3ClRYg0qIDArEHz5MbM3tRXtfL8F6pS9MCn9Lu263MQ/s72-c/Thrashing-in-OS.webp" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5313576602653501716.post-2826541520864433921</id><published>2020-04-27T20:34:00.001+05:30</published><updated>2020-04-27T21:13:22.537+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Operating-System"/><title type='text'>Free Space Management in OS | Multi Threading</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;a href=&quot;https://www.allbca.com/2020/03/Operating-System-Notes-BCA.html&quot;&gt;&lt;strong&gt;Operating System&lt;/strong&gt;&lt;/a&gt;: Q1.&lt;strong&gt;Free Space Management in OS&lt;/strong&gt;? Q2.&lt;strong&gt;Multi Threading&lt;/strong&gt;? - with example. &lt;strong&gt;(&lt;a href=&quot;https://www.allbca.com/search/label/Operating-System&quot;&gt;Operating System all notes&lt;/a&gt;)&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_A5j3i_7aoQyBjyi2MWdhujWyu-RAKGAzj5xvJDHcgVe52WDT3yQvfC2pv3oSvgiSLJGYqK5h_uDYx69VybTUUTaa5mH4z76UHTAuwaO947oAxYPgzXSG6BLLCyhwJUDQp3S2MEDAiw/s1600/Free-Space-Management-in-OS.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Free-Space-Management-in-OS&quot; border=&quot;0&quot; data-original-height=&quot;600&quot; data-original-width=&quot;800&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_A5j3i_7aoQyBjyi2MWdhujWyu-RAKGAzj5xvJDHcgVe52WDT3yQvfC2pv3oSvgiSLJGYqK5h_uDYx69VybTUUTaa5mH4z76UHTAuwaO947oAxYPgzXSG6BLLCyhwJUDQp3S2MEDAiw/s640/Free-Space-Management-in-OS.webp&quot; title=&quot;Free-Space-Management-in-OS&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q1. What is free space management?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans.&lt;/strong&gt; We need free space management because it is used to reuse the space from deleted files for new files, if it is possible. The system contains a free space list that holds the list of free spaces in the disk.&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;It includes:&lt;/span&gt;&lt;span style=&quot;color: #f3f3f3;&quot;&gt; Free Space Management in OS&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;strong&gt;(a) Bit Vector:&lt;/strong&gt; Fast for contiguous allocation and small disks especially with hardware support.&lt;br /&gt;
&lt;strong&gt;(b)&lt;/strong&gt; Linked List.&lt;br /&gt;
&lt;strong&gt;(c)&lt;/strong&gt; Grouping free block contains addresses of the free block and the last free block contains the address of the next block containing addresses of free blocks.&lt;br /&gt;
&lt;strong&gt;(d)&lt;/strong&gt; Counting disk addresses and free count of contiguous blocks.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEii7EkAHcZ96y1QYiMzpWKYuHtd16SZAj66MqE01sla0AK3QJvWdYl6MLJ2dr0-sguB5BgilVAsIxDIRB774FVHEUZI-po-O9RYNrrASGVZxV3kGxh8wRt5bN_svnu9BIuOWNTEhPS6dA/s1600/Thread-and-Multi-Threading.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Thread-and-Multi-Threading&quot; border=&quot;0&quot; data-original-height=&quot;600&quot; data-original-width=&quot;800&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEii7EkAHcZ96y1QYiMzpWKYuHtd16SZAj66MqE01sla0AK3QJvWdYl6MLJ2dr0-sguB5BgilVAsIxDIRB774FVHEUZI-po-O9RYNrrASGVZxV3kGxh8wRt5bN_svnu9BIuOWNTEhPS6dA/s640/Thread-and-Multi-Threading.webp&quot; title=&quot;Thread-and-Multi-Threading&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q2. Describe Multi Threading with suitable example?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans. Multithreading Concept:&lt;/strong&gt; A thread is the basic unit of CPU utilization. It consists of thread ID, a program counter, a register set, and a stack. It shares with other threads belonging to the same process is a code section, data section, and other resources.&lt;br /&gt;
If a process has multiple threads of control it can perform more than one task at a time. This is called a multithreading concept.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Example:&lt;/strong&gt; A word processor may have the thread for displaying graphics, another thread for responding to keystrokes from the user, and a third thread for performing spelling and grammar checking is the background.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxamw4J4WT9Hjm4eYrsIKF4UmWuSohCMynKGlEk44OOboZk6Og8R2SAkqVvo0P5EGOwUK3xh4m19I-Go10jly6zruGG8pu6vrgFAzp5SpfZxT7wIbhzgUsaQFP5T70PJ9ILxJTOWVQ1w/s1600/Thread-and-Multi-Threading-diagram.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Thread-and-Multi-Threading-diagram&quot; border=&quot;0&quot; data-original-height=&quot;554&quot; data-original-width=&quot;1600&quot; height=&quot;220&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxamw4J4WT9Hjm4eYrsIKF4UmWuSohCMynKGlEk44OOboZk6Og8R2SAkqVvo0P5EGOwUK3xh4m19I-Go10jly6zruGG8pu6vrgFAzp5SpfZxT7wIbhzgUsaQFP5T70PJ9ILxJTOWVQ1w/s640/Thread-and-Multi-Threading-diagram.webp&quot; title=&quot;Thread-and-Multi-Threading-diagram&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;Benefits of Multi Threading:&lt;/span&gt;&lt;/h3&gt;
&lt;strong&gt;1. Responsiveness:&lt;/strong&gt; For example, a multithreaded web browser could still allow user interaction in one thread while an image was being loaded in another thread.&lt;br /&gt;
&lt;strong&gt;2. Resource Sharing:&lt;/strong&gt; It allows an application to have several different threads of activity within the same address space.&lt;br /&gt;
&lt;strong&gt;3. Economy:&lt;/strong&gt; Because threads share resources of the process to which they belong.&lt;br /&gt;
&lt;strong&gt;4. Utilization of Multiprocessor Architecture:&lt;/strong&gt; Multithreading on a multi-CPU machine increases concurrency.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;[ Topic= Free Space Management in OS, Multi Threading ]&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Join us on Facebook, Instagram, and Twitter to get the latest study material. You can also ask us any questions.&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;Facebook =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;a href=&quot;https://www.fb.com/allbcaweb&quot; rel=&quot;nofollow&quot; style=&quot;color: blue;&quot;&gt;@allbcaweb&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Facebook)&lt;br /&gt;
&lt;b&gt;Instagram&lt;/b&gt; = &lt;a href=&quot;https://www.instagram.com/allbcaweb/&quot; rel=&quot;nofollow noopener noreferrer&quot; target=&quot;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;@allbcaweb&lt;/b&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Instagram)&lt;br /&gt;
&lt;strong&gt;Twitter =&amp;nbsp;&lt;span style=&quot;color: #00ccff;&quot;&gt;&lt;a href=&quot;https://www.twitter.com/allbcaweb&quot; rel=&quot;nofollow&quot; style=&quot;color: #00ccff;&quot;&gt;@allbcaweb&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Twitter)&lt;br /&gt;
&lt;b&gt;Email=&amp;nbsp;&lt;a href=&quot;mailto:allbca.com@gmail.com&quot;&gt;allbca.com@gmail.com&lt;/a&gt;&lt;br /&gt;Send us your query anytime about Free Space Management in OS!&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: #993366;&quot;&gt;External Links:-&lt;/span&gt;&lt;/h3&gt;
1. Free Space Management in OS - (&lt;a href=&quot;https://www.geeksforgeeks.org/free-space-management-in-operating-system/&quot; target=&quot;_blank&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
2. Multi Threading&amp;nbsp;- (&lt;a href=&quot;https://en.wikipedia.org/wiki/Multithreading_(computer_architecture)&quot; target=&quot;_blank&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #f3f3f3;&quot;&gt;[ Topic= Multi Threading, Multi Threading ]&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/2826541520864433921'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/2826541520864433921'/><link rel='alternate' type='text/html' href='https://www.allbca.com/2020/04/free-space-management-in-os.html' title='Free Space Management in OS | Multi Threading'/><author><name>Mayank Rana</name><uri>http://www.blogger.com/profile/06163424302596650438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs9mOMQbRjoNrVnY7AbBycXEpeOG7szPXA2y_RbbeTVJ25GEGpq6q-gZxcoKqROoy4G51CI9ZCvXhjBXCUH8gb-MvrIfJnbBBdt4BY6sgH3zI2blMucgSoV-XQYw6d9g/s125/mayankrana.webp'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_A5j3i_7aoQyBjyi2MWdhujWyu-RAKGAzj5xvJDHcgVe52WDT3yQvfC2pv3oSvgiSLJGYqK5h_uDYx69VybTUUTaa5mH4z76UHTAuwaO947oAxYPgzXSG6BLLCyhwJUDQp3S2MEDAiw/s72-c/Free-Space-Management-in-OS.webp" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5313576602653501716.post-154381921607774725</id><published>2020-04-27T15:54:00.001+05:30</published><updated>2020-04-28T18:34:21.075+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Operating-System"/><title type='text'>Directory Structure in OS | Types of directory structures</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;a href=&quot;https://www.allbca.com/2020/03/Operating-System-Notes-BCA.html&quot;&gt;&lt;strong&gt;Operating System&lt;/strong&gt;&lt;/a&gt;: Q1.&lt;strong&gt;Directory Structure in OS&lt;/strong&gt;? - Types of Directory Structures &lt;strong&gt;(&lt;a href=&quot;https://www.allbca.com/search/label/Operating-System&quot;&gt;Operating System all notes&lt;/a&gt;)&lt;/strong&gt; &lt;b&gt;&lt;span style=&quot;color: white;&quot;&gt;[ Topic= Directory Structure in OS ]&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifUfoy4KWljUKpaXa9s5A2CtQaxf3Mn3ICY7jfdS5zxY68rqnwqE7KyWzhhCwr5vyfJSMhhIqiJejbi-DcRT_roDlWBSYpbXRurMSrm59k4kIzBZwuIp3gQhBfGGo0bMfHCaXATV5QmA/s1600/Directory-Structure-in-OS.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Directory-Structure-in-OS&quot; border=&quot;0&quot; data-original-height=&quot;600&quot; data-original-width=&quot;800&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifUfoy4KWljUKpaXa9s5A2CtQaxf3Mn3ICY7jfdS5zxY68rqnwqE7KyWzhhCwr5vyfJSMhhIqiJejbi-DcRT_roDlWBSYpbXRurMSrm59k4kIzBZwuIp3gQhBfGGo0bMfHCaXATV5QmA/s640/Directory-Structure-in-OS.webp&quot; title=&quot;Directory-Structure-in-OS&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q1. Why is Directory Structure needed for files? Or Describe the Directory Structure in OS? with example? Types of Directory Structures?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans. Directory Structure:&lt;/strong&gt; Directories are considered as the symbolic tables of the file that store all the related information about the file, with the content. This information includes hile attributes, location, type, and access privileges. Directories are also known as containers for the files. The directory is itself a file that is owned by the operating system.&lt;br /&gt;
&lt;br /&gt;
There are millions of files present in the system that needed to be managed. Directories provide a means to organize files in a structure. Each entry in a directory contains information about a file.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Following operations can be performed on these entries :&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;1. Searching a File:&lt;/strong&gt; Whenever a file is referenced, the directory must search for the related entry.&lt;br /&gt;
&lt;strong&gt;2. Create a File:&lt;/strong&gt; An entry for every newly created file needs to be added in the directory.&lt;br /&gt;
&lt;strong&gt;3. Delete a File:&lt;/strong&gt; Whenever a file is deleted, the related entry should be removed from the directory.&lt;br /&gt;
&lt;strong&gt;4. List Directory:&lt;/strong&gt; List of files in a directory should be known whenever a user requests for it.&lt;br /&gt;
&lt;strong&gt;5. Rename a File:&lt;/strong&gt; The name of the file should be changeable when the use of file changes or its location changes.&lt;br /&gt;
&lt;strong&gt;6. Update Directory:&lt;/strong&gt; Whenever a file attribute changes, its corresponding entry needs to be updated&lt;br /&gt;
&lt;br /&gt;
On the basis of these entries and their operations, structure for directories can be organized in different ways. The three most common structures for organizing directories are single level, two-level, and hierarchical structure.&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;&lt;b&gt;[ Topic= Directory Structure in OS ]&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;1. Single-Level Structure:&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt; Directory Structure in OS&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
It is the most simplest form of directory structures having only one level of directories. All the files are contained in the same directory. The directory structure was implemented in the old versions of the single-user system. It becomes outdated and inadequate in a multiple user system.&lt;br /&gt;
&lt;br /&gt;
For every single user, it is difficult to keep track of the files, if the number of files increases. Moreover, files are of different types such as graphic files, text files, and executable files and if a user wants to arrange these files in an organized manner such as group files by type, this structure becomes inconvenient.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgk72El6iIqbDHAevtpCafEpy2ghmf4QQEqkwF1xigvkgLb1oomP4RN9mmY0xZwsW6rI8hr4zl9hQBUZf2oplXJ3UVLUP4kYYyVDuZHZPOP_uc6YWarIx_7_ttdhzGA9F89Z60imRTMHw/s1600/Single-level-Structure-in-OS.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Single-level-Structure-in-OS&quot; border=&quot;0&quot; data-original-height=&quot;369&quot; data-original-width=&quot;1600&quot; height=&quot;146&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgk72El6iIqbDHAevtpCafEpy2ghmf4QQEqkwF1xigvkgLb1oomP4RN9mmY0xZwsW6rI8hr4zl9hQBUZf2oplXJ3UVLUP4kYYyVDuZHZPOP_uc6YWarIx_7_ttdhzGA9F89Z60imRTMHw/s640/Single-level-Structure-in-OS.webp&quot; title=&quot;Single-level-Structure-in-OS&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;2. Two-Level Structure:&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt; Directory Structure in OS&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
As the name suggests, this structure is divided into two levels of directories, a master directory and user directories as subdirectories of the master directory. A separate directory is provided to each other and all these directories are contained and indexed in a master directory. A user directory represents a list of the files of a specific user.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;1.&lt;/strong&gt; The two-level structure looks like an inverted tree of height.&lt;br /&gt;
&lt;strong&gt;2.&lt;/strong&gt; The root of this tree is a master directory having user directories as its branches. Files are the leaves of these branches.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6tXzJ6DFGuj4IzurTFGcFzVvSOTE4iV_cMdu7nsC7iB1TudLdrPk9krfAD28yKKCoKUAvjcDEesydKSpWfxyhL4CSTteI048CPzaeuOsWVIraQoWVkyUYRSFq6Kf0zz2QTMIhjIx52A/s1600/Two-level-Structure-in-OS.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Two-level-Structure-in-OS&quot; border=&quot;0&quot; data-original-height=&quot;421&quot; data-original-width=&quot;1600&quot; height=&quot;168&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6tXzJ6DFGuj4IzurTFGcFzVvSOTE4iV_cMdu7nsC7iB1TudLdrPk9krfAD28yKKCoKUAvjcDEesydKSpWfxyhL4CSTteI048CPzaeuOsWVIraQoWVkyUYRSFq6Kf0zz2QTMIhjIx52A/s640/Two-level-Structure-in-OS.webp&quot; title=&quot;Two-level-Structure-in-OS&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
A user name and the file name is the pathname for a file. This structure solves the problem of unique names up to a certain extent, a user can assign duplicate names to files, provided the files are present in different directories.&lt;br /&gt;
The names need to be unique in the user&#39;s own directory because the names of two files can&#39;t be the same in a single directory. A user searches a file in his own directory only, which allows different users to have files with the same names.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;3. Hierarchical Structure: &lt;/span&gt;&lt;/h3&gt;
This is the most powerful and flexible structure and is implemented in almost every operating system. The two-level structure is extended into the more advanced hierarchical structure of arbitrary levels. It uses the concept of the two-level structure of the master directory having user directories as subdirectories. In addition, each user directory, in turn, has sub-directories and files as its branches and leaves.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFzvzZSelj746geHeTcsuJFHLRJVfP5xT_Pr912BhY2Ea4yTzH-WO7U3Hc-zvogep4kr1tGAj6emlwK0czqsK_Tl4rOmpCjCqd9oQJ5XbEAOZylvp0sp1Uaknw8jYGk3rbUwy9g6AdTQ/s1600/Hierarchical-Two-level-Structure-in-OS.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Hierarchical-Two-level-Structure-in-OS&quot; border=&quot;0&quot; data-original-height=&quot;580&quot; data-original-width=&quot;1600&quot; height=&quot;230&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFzvzZSelj746geHeTcsuJFHLRJVfP5xT_Pr912BhY2Ea4yTzH-WO7U3Hc-zvogep4kr1tGAj6emlwK0czqsK_Tl4rOmpCjCqd9oQJ5XbEAOZylvp0sp1Uaknw8jYGk3rbUwy9g6AdTQ/s640/Hierarchical-Two-level-Structure-in-OS.webp&quot; title=&quot;Hierarchical-Two-level-Structure-in-OS&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Users can create their own sub-directories to organize files of different types such as, a separate sub-directory for graphic files or a separate sub-directory for text files. Special system calls are used to create or delete directories. Internal format, which is the internal structure in which the details of a directory are stored, of each directory, has an entry that stores a special bit representing a sub-directory or a file, 0 bit represents a file and 1 bit represents a directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: white;&quot;&gt;[ Topic= Directory Structure in OS ]&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;[ Topic= Directory Structure in OS ]&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: white;&quot;&gt;[ Topic= Directory Structure in OS ]&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Join us on Facebook, Instagram, and Twitter to get the latest study material. You can also ask us any questions.&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;Facebook =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;a href=&quot;https://www.fb.com/allbcaweb&quot; rel=&quot;nofollow&quot; style=&quot;color: blue;&quot;&gt;@allbcaweb&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Facebook)&lt;br /&gt;
&lt;b&gt;Instagram&lt;/b&gt; = &lt;a href=&quot;https://www.instagram.com/allbcaweb/&quot; rel=&quot;nofollow noopener noreferrer&quot; target=&quot;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;@allbcaweb&lt;/b&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Instagram)&lt;br /&gt;
&lt;strong&gt;Twitter =&amp;nbsp;&lt;span style=&quot;color: #00ccff;&quot;&gt;&lt;a href=&quot;https://www.twitter.com/allbcaweb&quot; rel=&quot;nofollow&quot; style=&quot;color: #00ccff;&quot;&gt;@allbcaweb&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Twitter)&lt;br /&gt;
&lt;b&gt;Email=&amp;nbsp;&lt;a href=&quot;mailto:allbca.com@gmail.com&quot;&gt;allbca.com@gmail.com&lt;/a&gt;&lt;br /&gt;Send us your query anytime about Directory Structure in OS!&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: #993366;&quot;&gt;External Links:-&lt;/span&gt;&lt;/h3&gt;
1. Directory Structure in OS - (&lt;a href=&quot;https://www.geeksforgeeks.org/structures-of-directory-in-operating-system/&quot; target=&quot;_blank&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
2. Directory Structure in OS - (&lt;a href=&quot;https://www.javatpoint.com/os-directory-structure&quot; target=&quot;_blank&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: white;&quot;&gt;[ Topic= Directory Structure in OS ]&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;[ Topic= Directory Structure in OS ]&lt;/b&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/154381921607774725'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/154381921607774725'/><link rel='alternate' type='text/html' href='https://www.allbca.com/2020/04/directory-structure-in-os.html' title='Directory Structure in OS | Types of directory structures'/><author><name>Mayank Rana</name><uri>http://www.blogger.com/profile/06163424302596650438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs9mOMQbRjoNrVnY7AbBycXEpeOG7szPXA2y_RbbeTVJ25GEGpq6q-gZxcoKqROoy4G51CI9ZCvXhjBXCUH8gb-MvrIfJnbBBdt4BY6sgH3zI2blMucgSoV-XQYw6d9g/s125/mayankrana.webp'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifUfoy4KWljUKpaXa9s5A2CtQaxf3Mn3ICY7jfdS5zxY68rqnwqE7KyWzhhCwr5vyfJSMhhIqiJejbi-DcRT_roDlWBSYpbXRurMSrm59k4kIzBZwuIp3gQhBfGGo0bMfHCaXATV5QmA/s72-c/Directory-Structure-in-OS.webp" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5313576602653501716.post-1969305879119030165</id><published>2020-04-26T20:51:00.001+05:30</published><updated>2020-04-26T21:22:33.124+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Operating-System"/><title type='text'>File Allocation Methods in OS - Linked Allocation</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;a href=&quot;https://www.allbca.com/2020/03/Operating-System-Notes-BCA.html&quot;&gt;&lt;strong&gt;Operating System&lt;/strong&gt;&lt;/a&gt;: Q1.&lt;strong&gt;File Allocation Methods in OS&lt;/strong&gt;? - &lt;strong&gt;Linked Allocation&lt;/strong&gt;, Contiguous Allocation, Indexed Allocation. &lt;strong&gt;(&lt;a href=&quot;https://www.allbca.com/search/label/Operating-System&quot;&gt;Operating System all notes&lt;/a&gt;)&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbz_dOXGJR_R7qm5vu8qdwitNUEf2_ERHV5cavpQnKMevODkYJd96T5up6Hra0oPWeFYnZ0uJjzY28jEQNRNtx_56l2Wl0ohW6a93b6_62sC1V3GzoeDgh4pOMtgj9u8Yvp1_XUm58sA/s1600/File-Allocation-Methods-in-OS.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;File-Allocation-Methods-in-OS&quot; border=&quot;0&quot; data-original-height=&quot;600&quot; data-original-width=&quot;800&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbz_dOXGJR_R7qm5vu8qdwitNUEf2_ERHV5cavpQnKMevODkYJd96T5up6Hra0oPWeFYnZ0uJjzY28jEQNRNtx_56l2Wl0ohW6a93b6_62sC1V3GzoeDgh4pOMtgj9u8Yvp1_XUm58sA/s640/File-Allocation-Methods-in-OS.webp&quot; title=&quot;File-Allocation-Methods-in-OS&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q1. Explain the accessing methods used for searching in these file organization schemes? or File Allocation Methods in OS?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans. Allocation Method:&lt;/strong&gt; Disks are the storing devices that can store a large number of files. The important point that we need to consider when storing files is that we should allocate space to these files in such a manner that space can be utilized effectively.&lt;br /&gt;
&lt;br /&gt;
As a result, it helps in accessing files quickly. There are three methods used for allocating space to files: contiguous allocation, linked allocation, and indexed allocation.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjrFpJESQ24-5P-NwU4Wm2IrgwyqOcbcdT9biFSBrYZ8VhVvUFLYiAh04Xe8_E2jTM8ykq9H2tr-eHpNRphh_-g-71cI75otiRih9CTM4q4WDPfrByj1zCEKnpDAYJAID9EuVdJdwghw/s1600/File-Allocation-Methods-Diagram.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;File-Allocation-Methods-Diagram&quot; border=&quot;0&quot; data-original-height=&quot;872&quot; data-original-width=&quot;1600&quot; height=&quot;348&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjrFpJESQ24-5P-NwU4Wm2IrgwyqOcbcdT9biFSBrYZ8VhVvUFLYiAh04Xe8_E2jTM8ykq9H2tr-eHpNRphh_-g-71cI75otiRih9CTM4q4WDPfrByj1zCEKnpDAYJAID9EuVdJdwghw/s640/File-Allocation-Methods-Diagram.webp&quot; title=&quot;File-Allocation-Methods-Diagram&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;1. Contiguous Allocation:&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt; File Allocation Methods in OS &lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
According to this method, every file occupies a set of contiguous blocks on the disk. e.g. there is only a single job accessing the disk. The head movement of the disk is not required, if a job accesses blocks &lt;em&gt;B + 1&lt;/em&gt; after the block B.&lt;br /&gt;
&lt;br /&gt;
If there is a need for the head movement, then the head moves from one track to next. Therefore, this allocation method requires minimum disk seeks. Due to its better performance, this allocation method is used by several systems.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;2. Linked Allocation:&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt; File Allocation Methods in OS&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
In this method, every file is linked list of disk blocks. These disk blocks are present all over the disk. This allocation method removes all the limitations of the contiguous allocation method. Every block contains a pointer for the next block. These pointers are not available to users.&lt;br /&gt;
&lt;br /&gt;
e.g.: If the size of a block is 512 bytes and the pointer requires 4 bytes, then the bytes available to the user are 508.&lt;br /&gt;
&lt;br /&gt;
In this, there is a file, which consists of five blocks. It starts at block 8 and continues to block 18, then to block 1, then to block 11 and finally it lasts at block 22.&lt;br /&gt;
&lt;br /&gt;
In this, there is a file, which consists of five blocks. It starts at block 8 and continues to block 18, then to block 1, then to block 11 and finally it lasts at block 22.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggHHTKC2URWKc4dPY-gSGcI0UcGp8h6OnIq_dGjR5DMYru5XSd6B-Uhyphenhyphenyh5ai_-I-NQAMEnOmeGc4IESVF-Q-XrkK_ivl83u4Edwbk9wwGkUmNVnELz12eS0zz4g3R83GV0mTjbaXulg/s1600/Linked-Allocation-Methods-in-OS.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Linked-Allocation-Methods-in-OS&quot; border=&quot;0&quot; data-original-height=&quot;915&quot; data-original-width=&quot;1600&quot; height=&quot;364&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggHHTKC2URWKc4dPY-gSGcI0UcGp8h6OnIq_dGjR5DMYru5XSd6B-Uhyphenhyphenyh5ai_-I-NQAMEnOmeGc4IESVF-Q-XrkK_ivl83u4Edwbk9wwGkUmNVnELz12eS0zz4g3R83GV0mTjbaXulg/s640/Linked-Allocation-Methods-in-OS.webp&quot; title=&quot;Linked-Allocation-Methods-in-OS&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;3. Indexed Allocation:&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt; File Allocation Methods in OS&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
This method of allocation solves all the problems of the linked allocation method. It solves the problem by bringing all the pointers at a particular place, which is known as the index block.&lt;br /&gt;
&lt;br /&gt;
An individual index block is provided to every file and it contains all the disk block addresses. The K&lt;sup&gt;th&lt;/sup&gt; entry points to the K&lt;sup&gt;th&lt;/sup&gt; block of the file. We can find and read the K&lt;sup&gt;th&lt;/sup&gt; block by using the pointer in the K&lt;sup&gt;th&lt;/sup&gt; index block. When creating a file, all the pointers are set to nil.&lt;br /&gt;
&lt;br /&gt;
This method solves the external fragmentation problem to direct method by allowing any block to satisfy a request for large space. Also, no space is wasted in this method and by using any of the following schemes.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1KP-P6TWQ648kCzCyck65YgTAZiGj2c4__Gk93EJ_kRaTm2hd6gtI0C4BW5RGIoV6qTBHBjDhnPDcMABQ_RIZkZ-paAz83HsxnF1sLgA9dNqnsYv_z6KWBUhnrQxDwADNN1uzbklfFA/s1600/Indexed-Allocation-Methods-in-OS.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Indexed-Allocation-Methods-in-OS&quot; border=&quot;0&quot; data-original-height=&quot;834&quot; data-original-width=&quot;1600&quot; height=&quot;332&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1KP-P6TWQ648kCzCyck65YgTAZiGj2c4__Gk93EJ_kRaTm2hd6gtI0C4BW5RGIoV6qTBHBjDhnPDcMABQ_RIZkZ-paAz83HsxnF1sLgA9dNqnsYv_z6KWBUhnrQxDwADNN1uzbklfFA/s640/Indexed-Allocation-Methods-in-OS.webp&quot; title=&quot;Indexed-Allocation-Methods-in-OS&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q2. Advantages and Disadvantages of Indexed Allocation?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans. The advantages and disadvantages of linked allocation are as follows:&lt;/strong&gt;&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;Advantages of linked allocation:&lt;/span&gt;&lt;/h3&gt;
&lt;strong&gt;(i)&lt;/strong&gt; Its simplicity.&lt;br /&gt;
&lt;strong&gt;(ii)&lt;/strong&gt; No disk compaction required. Because of the non-contiguous nature of allocation, the linking does not produce any external disk fragmentation. Any disk block on the free space can be used to satisfy a request. since all blocks are linked together.&lt;br /&gt;
&lt;br /&gt;
There is also no need of declaration of the size of a file in linked allocation while it is created. A file can continue to grow as there are free blocks. Consequently, it is never necessary to have disk compaction.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;Disadvantages of linked allocation:&lt;/span&gt;&lt;/h3&gt;
&lt;strong&gt;(i) Slow Direct Accessing of any Disk Block:&lt;/strong&gt; To find out the &lt;em&gt;Nth&lt;/em&gt; block of a file, we must start at the beginning of that file and follow the pointer until we get to the &lt;em&gt;Nth&lt;/em&gt; block.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;(ii) Space Requirement for Pointers:&lt;/strong&gt; If a pointer requires two words out of a 512 words block, then around 39 percent of the disk is being ponded only for pointers, not for information. Each file therefore requires more space.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;(iii) Reliability:&lt;/strong&gt; Since disk blocks are linked by pointers, a single damaged pointer can make thousands of disk blocks inaccessible. Some operating systems address this problem by storing pointers in a dedicated file and making redundant copies of it.&lt;br /&gt;
&lt;br /&gt;
The idea is to copy the list of pointers into the main memory and thus facilitate faster access of disk blocks. The redundancy of pointers files is employed for safer recovery.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: white;&quot;&gt;[ Topic= File Allocation Methods in OS ]&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;[ Topic= File Allocation Methods in OS ]&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: white;&quot;&gt;[ Topic= File Allocation Methods in OS ]&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Join us on Facebook, Instagram, and Twitter to get the latest study material. You can also ask us any questions.&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;Facebook =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;a href=&quot;https://www.fb.com/allbcaweb&quot; rel=&quot;nofollow&quot; style=&quot;color: blue;&quot;&gt;@allbcaweb&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Facebook)&lt;br /&gt;
&lt;b&gt;Instagram&lt;/b&gt; = &lt;a href=&quot;https://www.instagram.com/allbcaweb/&quot; rel=&quot;nofollow noopener noreferrer&quot; target=&quot;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;@allbcaweb&lt;/b&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Instagram)&lt;br /&gt;
&lt;strong&gt;Twitter =&amp;nbsp;&lt;span style=&quot;color: #00ccff;&quot;&gt;&lt;a href=&quot;https://www.twitter.com/allbcaweb&quot; rel=&quot;nofollow&quot; style=&quot;color: #00ccff;&quot;&gt;@allbcaweb&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Twitter)&lt;br /&gt;
&lt;b&gt;Email=&amp;nbsp;&lt;a href=&quot;mailto:allbca.com@gmail.com&quot;&gt;allbca.com@gmail.com&lt;/a&gt;&lt;br /&gt;Send us your query anytime about File Allocation Methods in OS!&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: #993366;&quot;&gt;External Links:-&lt;/span&gt;&lt;/h3&gt;
1. File Allocation Methods in OS - (&lt;a href=&quot;https://www.geeksforgeeks.org/file-allocation-methods/&quot; target=&quot;_blank&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
2. File Allocation Methods in OS - (&lt;a href=&quot;https://en.wikibooks.org/wiki/Operating_System_Design/File_Systems/Allocation&quot; target=&quot;_blank&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;[ Topic= File Allocation Methods in OS ]&lt;/b&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/1969305879119030165'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/1969305879119030165'/><link rel='alternate' type='text/html' href='https://www.allbca.com/2020/04/file-allocation-methods-in-os.html' title='File Allocation Methods in OS - Linked Allocation'/><author><name>Mayank Rana</name><uri>http://www.blogger.com/profile/06163424302596650438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs9mOMQbRjoNrVnY7AbBycXEpeOG7szPXA2y_RbbeTVJ25GEGpq6q-gZxcoKqROoy4G51CI9ZCvXhjBXCUH8gb-MvrIfJnbBBdt4BY6sgH3zI2blMucgSoV-XQYw6d9g/s125/mayankrana.webp'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbz_dOXGJR_R7qm5vu8qdwitNUEf2_ERHV5cavpQnKMevODkYJd96T5up6Hra0oPWeFYnZ0uJjzY28jEQNRNtx_56l2Wl0ohW6a93b6_62sC1V3GzoeDgh4pOMtgj9u8Yvp1_XUm58sA/s72-c/File-Allocation-Methods-in-OS.webp" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5313576602653501716.post-7857796515560613418</id><published>2020-04-26T14:39:00.001+05:30</published><updated>2020-04-26T15:35:30.977+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Operating-System"/><title type='text'>CPU Process Scheduling Algorithms in OS</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;a href=&quot;https://www.allbca.com/2020/03/Operating-System-Notes-BCA.html&quot;&gt;&lt;strong&gt;Operating System&lt;/strong&gt;&lt;/a&gt;: &lt;span style=&quot;color: red;&quot;&gt;Q1. &lt;strong&gt;Discuss various Scheduling Algorithms with examples&lt;/strong&gt;?&lt;/span&gt; - &lt;strong&gt;First Come First Serve scheduling&lt;/strong&gt;, &lt;strong&gt;Shortest Job First scheduling&lt;/strong&gt;, &lt;strong&gt;Round Robin scheduling&lt;/strong&gt;, &lt;strong&gt;Priority scheduling&lt;/strong&gt;, &lt;strong&gt;Multi-Level Queue scheduling&lt;/strong&gt;, &lt;strong&gt;Multi-Level Feedback Queue scheduling&lt;/strong&gt;. &lt;strong&gt;(&lt;a href=&quot;https://www.allbca.com/search/label/Operating-System&quot;&gt;Operating System all notes&lt;/a&gt;)&lt;/strong&gt; &lt;span style=&quot;color: #f3f3f3;&quot;&gt;: CPU Scheduling Algorithms in OS, Process Scheduling Algorithms in OS.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjG29-IW1mrksdZp7cTpRv47SHO-yUpC8OAzJ09L_3x17JHThAw_c1PqKR4U8CKIPZUUUGB-RCuXdU4xn79Rp7XA4tSBh-5GATHHCHK8qwKNHtBfL-7EGlKb02pu3-GAvuEzJ1o_XjW9Q/s1600/CPU-Process-Scheduling-Algorithms-in-OS.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;CPU-Process-Scheduling-Algorithms-in-OS&quot; border=&quot;0&quot; data-original-height=&quot;600&quot; data-original-width=&quot;800&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjG29-IW1mrksdZp7cTpRv47SHO-yUpC8OAzJ09L_3x17JHThAw_c1PqKR4U8CKIPZUUUGB-RCuXdU4xn79Rp7XA4tSBh-5GATHHCHK8qwKNHtBfL-7EGlKb02pu3-GAvuEzJ1o_XjW9Q/s640/CPU-Process-Scheduling-Algorithms-in-OS.png&quot; title=&quot;CPU-Process-Scheduling-Algorithms-in-OS&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q1. Discuss various Scheduling Algorithms with examples?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans. There are various CPU process scheduling algorithms in OS:&lt;/strong&gt;&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;1. First Come First Serve (FCFS) Scheduling:&lt;span style=&quot;color: #999999;&quot;&gt; CPU Scheduling Algorithms in OS&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
FCFS is the simplest scheduling algorithm, its implementation is straightforward which is maintained by FIFO (First In First Out) queue. Once a process has the CPU, it runs to completion. A FCFS scheduling is non-preemptive which usually results in poor performance. As a consequence of non-preemption, there is a low rate of resource utilization and system throughput.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/span&gt; Calculate the turn around time, waiting time, average turn around time, average waiting time, throughput, and processor utilization for the given set of processes that arrive at a given arrival time.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0x_2UockCXUrZZl2_REo1oBjIz1XJch54YUHXIj32R3X1znqEVvPo_zLsHw0er6ZcIobMuNEng8awq5HnoUp-BYhIALwyOUFKgcJNGdOq_LTU3eeGrodayy9Bme9Rmc1r4FlxchL0uw/s1600/First-Come-First-Serve-scheduling-example.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;First-Come-First-Serve-scheduling-example&quot; border=&quot;0&quot; data-original-height=&quot;1197&quot; data-original-width=&quot;1600&quot; height=&quot;478&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0x_2UockCXUrZZl2_REo1oBjIz1XJch54YUHXIj32R3X1znqEVvPo_zLsHw0er6ZcIobMuNEng8awq5HnoUp-BYhIALwyOUFKgcJNGdOq_LTU3eeGrodayy9Bme9Rmc1r4FlxchL0uw/s640/First-Come-First-Serve-scheduling-example.webp&quot; title=&quot;First-Come-First-Serve-scheduling-example&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;2. Shortest Job First (SJF) Scheduling:&lt;span style=&quot;color: #999999;&quot;&gt; CPU Scheduling Algorithms in OS&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
Shortest job first scheduling is a non-preemptive discipline in which a waiting job with the smallest estimated run time to completion is run next. In other words, when CPU is available, it is assigned to the process that has the smallest next CPU burst. If two processes have the same CPU burst, FCFS is used. The SJF schedular searches the ready queue to find the job or the process with the shortest execution time.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/span&gt; Consider the following set of processes with the following processing time which arrived at the same time:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLj1z6Oj822n7q6-m-rRqg7sWALyoqw-hfobZTEWqvjwmizt_FLnKcxekn2spzKKxypbXqbu47IAOAfw45r6_bzDrwyunjIjcRbN8whalcWsedri5sINBEqCxmcYGjfsi7fby3oaygFA/s1600/Shortest-Job-First-scheduling-example-1.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Shortest-Job-First-scheduling-example-1&quot; border=&quot;0&quot; data-original-height=&quot;365&quot; data-original-width=&quot;1600&quot; height=&quot;90&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLj1z6Oj822n7q6-m-rRqg7sWALyoqw-hfobZTEWqvjwmizt_FLnKcxekn2spzKKxypbXqbu47IAOAfw45r6_bzDrwyunjIjcRbN8whalcWsedri5sINBEqCxmcYGjfsi7fby3oaygFA/s400/Shortest-Job-First-scheduling-example-1.webp&quot; title=&quot;Shortest-Job-First-scheduling-example-1&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Using SJF scheduling because the shortest length process will first get execution.&lt;br /&gt;
The Gantt chart will be:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjky1xgtm61WvcG7p9A2YiySFGdnCzTIZt7Bm14Pxsl3ZobLCIqVuqG_7kbPClZ7SmRpYJ46NEWG8EHEbgTldiwrFZnXaf5FUyAITJQKw0amzFRwe_zxds7nAAcp7DabD46VfpHcfLZrA/s1600/Shortest-Job-First-scheduling-example-2.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Shortest-Job-First-scheduling-example-2&quot; border=&quot;0&quot; data-original-height=&quot;746&quot; data-original-width=&quot;1600&quot; height=&quot;298&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjky1xgtm61WvcG7p9A2YiySFGdnCzTIZt7Bm14Pxsl3ZobLCIqVuqG_7kbPClZ7SmRpYJ46NEWG8EHEbgTldiwrFZnXaf5FUyAITJQKw0amzFRwe_zxds7nAAcp7DabD46VfpHcfLZrA/s640/Shortest-Job-First-scheduling-example-2.webp&quot; title=&quot;Shortest-Job-First-scheduling-example-2&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;3. Round Robin Scheduling:&lt;span style=&quot;color: #999999;&quot;&gt; CPU Scheduling Algorithms in OS&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
One of the oldest, simplest, fairest, and the most widely used algorithm is &lt;strong&gt;Round-Robin&lt;/strong&gt;. The round-robin scheduling algorithm is primarily used in time-sharing and multi-user system environments where the primary requirement is to provide reasonably good response times and in general to share the system fairly among all system users. Basically the CPU time is divided into the time slices. Each process is allocated a small time slice called &lt;strong&gt;Quantum&lt;/strong&gt;. No process can run for more than quantum while others are waiting in the ready queue.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/span&gt; Consider the following set of processes:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0wQNUY-LHkCaJ3w9q-e0m81ZO9skaH2eh8KKcorELXqbwZQQulT9ipCI2QNnWcmDMSsS606EWOMYAIeA-U7ZFUy6CD7CMqt8sWJFQoUMO9udEU2B4_WMP2NJ7x_6skr_x3Im-2kzWQg/s1600/Round-Robin-scheduling-example.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Round-Robin-scheduling-example&quot; border=&quot;0&quot; data-original-height=&quot;893&quot; data-original-width=&quot;1600&quot; height=&quot;356&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0wQNUY-LHkCaJ3w9q-e0m81ZO9skaH2eh8KKcorELXqbwZQQulT9ipCI2QNnWcmDMSsS606EWOMYAIeA-U7ZFUy6CD7CMqt8sWJFQoUMO9udEU2B4_WMP2NJ7x_6skr_x3Im-2kzWQg/s640/Round-Robin-scheduling-example.webp&quot; title=&quot;Round-Robin-scheduling-example&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;4. Priority Based Scheduling:&lt;span style=&quot;color: #999999;&quot;&gt; CPU Process Scheduling Algorithms in OS&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
A priority number is associated with each process. The basic idea is straightforward: each process is assigned a priority and priority is allowed to run. Equal priority processes are scheduled in FCFS order. The SJF algorithm is a special case of the general priority scheduling algorithm. SJF is a priority scheduling where priority is the predicted next CPU burst time. The CPU is allocated to the process with the highest priority. Equal priority processes are scheduled for FCFS.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/span&gt; Consider the following process:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3ICjwA6fZQKA-VUjB5zLKobWwKIfcXvRem2xJikSDF1VJhFu4iqH-SaqiXDaKvV9YUpME4bWUMfPo-iYfq_Q0YJweCLMHmKVTUq06KqPATbAd1nadG8_qMqr5ddT_nY9s8SE5a_Jd-A/s1600/Priority-scheduling-example.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Priority-scheduling-example&quot; border=&quot;0&quot; data-original-height=&quot;1254&quot; data-original-width=&quot;1600&quot; height=&quot;500&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3ICjwA6fZQKA-VUjB5zLKobWwKIfcXvRem2xJikSDF1VJhFu4iqH-SaqiXDaKvV9YUpME4bWUMfPo-iYfq_Q0YJweCLMHmKVTUq06KqPATbAd1nadG8_qMqr5ddT_nY9s8SE5a_Jd-A/s640/Priority-scheduling-example.webp&quot; title=&quot;Priority-scheduling-example&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;5. Multi-Level Queue (MLQ) Scheduling:&lt;span style=&quot;color: #999999;&quot;&gt; CPU Process Scheduling Algorithms in OS&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
A multi-queue scheduling algorithm partitions the ready queue in several separate queues. &lt;span style=&quot;color: purple;&quot;&gt;&lt;strong&gt;For example&lt;/strong&gt;&lt;/span&gt;, interactive processes and batch processes could be considered as two types of processes. In a multi-level queue scheduling processes are permanently assigned to one queues.&lt;br /&gt;
&lt;br /&gt;
The processes are permanently assigned to one another, based on some property of the process, such as:&lt;br /&gt;
&lt;strong&gt;(a)&lt;/strong&gt; Memory size.&lt;br /&gt;
&lt;strong&gt;(b)&lt;/strong&gt; Process priority.&lt;br /&gt;
&lt;strong&gt;(c)&lt;/strong&gt; Process type.&lt;br /&gt;
&lt;br /&gt;
The algorithm chooses the process from the occupied queue that has the highest priority and run that process either:&lt;br /&gt;
&lt;strong&gt;(a)&lt;/strong&gt; Preemptive.&lt;br /&gt;
&lt;strong&gt;(b)&lt;/strong&gt; Non-preemptive.&lt;br /&gt;
&lt;strong&gt;Each queue has its own scheduling algorithm or policy&lt;/strong&gt;.&lt;br /&gt;
&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;
&lt;span style=&quot;color: navy;&quot;&gt;&lt;strong&gt;Possibility I :&lt;/strong&gt;&lt;/span&gt; If each queue has absolute priority over lower priority queue then no process in the queue could run unless the queue for the highest priority processes were all empty.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: navy;&quot;&gt;&lt;strong&gt;Possibility II :&lt;/strong&gt;&lt;/span&gt; If there is a time slice between the queues then each queue gets a certain amount of CPU times, which it can then schedule among the processes in its queue :&lt;br /&gt;
&lt;strong&gt;(a)&lt;/strong&gt; 80% of the CPU time to foreground queue using RR.&lt;br /&gt;
&lt;strong&gt;(b)&lt;/strong&gt; 20% of the CPU time to background queue using FCFS.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;&lt;strong&gt;Background queue = Batch processes&lt;/strong&gt;&lt;/span&gt;,&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;&lt;strong&gt;Foreground queue = Interactive processes&lt;/strong&gt;&lt;/span&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;6. Multi-Level Feedback Queue Scheduling:&lt;/span&gt;&lt;/h3&gt;
A process can move between the various queues, aging can be implemented this way. Multi-level feedback queue scheduler is defined by the following parameters:&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;(a)&lt;/strong&gt; The number of queues.&lt;br /&gt;
&lt;strong&gt;(b)&lt;/strong&gt; The scheduling algorithm for each queue.&lt;br /&gt;
&lt;strong&gt;(c)&lt;/strong&gt; The method used to determine when to upgrade a process.&lt;br /&gt;
&lt;strong&gt;(d)&lt;/strong&gt; The method used to determine when to demote a process.&lt;br /&gt;
&lt;strong&gt;(e)&lt;/strong&gt; The method used to determine which queue a process will enter when that process needs service.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: purple;&quot;&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/span&gt; Three queues:&lt;br /&gt;
Q&lt;sub&gt;0&lt;/sub&gt; - RR with time quantum 8 milliseconds.&lt;br /&gt;
Q&lt;sub&gt;1&lt;/sub&gt; - RR time quantum 16 milliseconds.&lt;br /&gt;
Q&lt;sub&gt;2&lt;/sub&gt; - FCFS.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Scheduling:&lt;/strong&gt; A new job enters queue Q&lt;sub&gt;0&lt;/sub&gt; which is served FCFS. When it gains CPU, job receives 8 milliseconds, or it does not finish in 8 milliseconds, the job is moved to queue Q&lt;sub&gt;1&lt;/sub&gt; ,&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLUBcke51GU5RhJmCq50YctYzaUTXdYgax3zSnuyKFbZviaU_-oZdBkWic95yFoVnTKIp9aNFaOmqMFG2fmidoHHt2pSaaLwW0rgYq-OJlx1Jucvsu8zPO_VJi-Tdp4zDig0cMwKZOsg/s1600/Multi-Level-Feedback-Queue-scheduling-example.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Multi-Level-Feedback-Queue-scheduling-example&quot; border=&quot;0&quot; data-original-height=&quot;334&quot; data-original-width=&quot;1600&quot; height=&quot;131&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLUBcke51GU5RhJmCq50YctYzaUTXdYgax3zSnuyKFbZviaU_-oZdBkWic95yFoVnTKIp9aNFaOmqMFG2fmidoHHt2pSaaLwW0rgYq-OJlx1Jucvsu8zPO_VJi-Tdp4zDig0cMwKZOsg/s640/Multi-Level-Feedback-Queue-scheduling-example.webp&quot; title=&quot;Multi-Level-Feedback-Queue-scheduling-example&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
At Q&lt;sub&gt;1&lt;/sub&gt; job is again served FCFS and receives 16 additional milliseconds. If it still does not complete, it is preempted and moved to the queue Q&lt;sub&gt;2&lt;/sub&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #f3f3f3;&quot;&gt;[ Topic= CPU Process Scheduling Algorithms in OS&amp;nbsp;]&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;[ Topic= CPU Process Scheduling Algorithms in OS&amp;nbsp;]&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: #f3f3f3;&quot;&gt;[ Topic= CPU Process Scheduling Algorithms in OS&amp;nbsp;]&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Join us on Facebook, Instagram, and Twitter to get the latest study material. You can also ask us any questions.&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;Facebook =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;a href=&quot;https://www.fb.com/allbcaweb&quot; rel=&quot;nofollow&quot; style=&quot;color: blue;&quot;&gt;@allbcaweb&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Facebook)&lt;br /&gt;
&lt;b&gt;Instagram&lt;/b&gt; = &lt;a href=&quot;https://www.instagram.com/allbcaweb/&quot; rel=&quot;nofollow noopener noreferrer&quot; target=&quot;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;@allbcaweb&lt;/b&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Instagram)&lt;br /&gt;
&lt;strong&gt;Twitter =&amp;nbsp;&lt;span style=&quot;color: #00ccff;&quot;&gt;&lt;a href=&quot;https://www.twitter.com/allbcaweb&quot; rel=&quot;nofollow&quot; style=&quot;color: #00ccff;&quot;&gt;@allbcaweb&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Twitter)&lt;br /&gt;
&lt;b&gt;Email=&amp;nbsp;&lt;a href=&quot;mailto:allbca.com@gmail.com&quot;&gt;allbca.com@gmail.com&lt;/a&gt;&lt;br /&gt;Send us your query anytime about CPU Scheduling Algorithms in OS!&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: #993366;&quot;&gt;External Links:-&lt;/span&gt;&lt;/h3&gt;
1. CPU Scheduling Algorithms in OS - (&lt;a href=&quot;https://en.wikipedia.org/wiki/Scheduling_(computing)&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
2. Process Scheduling Algorithms in OS - (&lt;a href=&quot;https://www.tutorialspoint.com/operating_system/os_process_scheduling_algorithms.htm&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: #f3f3f3;&quot;&gt;[ Topic= CPU Process Scheduling Algorithms in OS&amp;nbsp;]&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;[ Topic= CPU Process Scheduling Algorithms in OS&amp;nbsp;]&lt;/b&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/7857796515560613418'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/7857796515560613418'/><link rel='alternate' type='text/html' href='https://www.allbca.com/2020/04/cpu-process-scheduling-algorithms-in-os.html' title='CPU Process Scheduling Algorithms in OS'/><author><name>Mayank Rana</name><uri>http://www.blogger.com/profile/06163424302596650438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs9mOMQbRjoNrVnY7AbBycXEpeOG7szPXA2y_RbbeTVJ25GEGpq6q-gZxcoKqROoy4G51CI9ZCvXhjBXCUH8gb-MvrIfJnbBBdt4BY6sgH3zI2blMucgSoV-XQYw6d9g/s125/mayankrana.webp'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjG29-IW1mrksdZp7cTpRv47SHO-yUpC8OAzJ09L_3x17JHThAw_c1PqKR4U8CKIPZUUUGB-RCuXdU4xn79Rp7XA4tSBh-5GATHHCHK8qwKNHtBfL-7EGlKb02pu3-GAvuEzJ1o_XjW9Q/s72-c/CPU-Process-Scheduling-Algorithms-in-OS.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5313576602653501716.post-8140082042503403013</id><published>2020-04-25T14:05:00.003+05:30</published><updated>2020-04-25T14:29:59.404+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Operating-System"/><title type='text'>Deadlock in OS - Deadlock Prevention, Deadlock Avoidance</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;a href=&quot;https://www.allbca.com/2020/03/Operating-System-Notes-BCA.html&quot;&gt;&lt;strong&gt;Operating System&lt;/strong&gt;&lt;/a&gt;: Q1.&lt;strong&gt;Deadlock in OS&lt;/strong&gt;? Q2.&lt;strong&gt;Four conditions that causes deadlock in OS&lt;/strong&gt;? Q3.&lt;strong&gt;Deadlock Prevention&lt;/strong&gt;? - How we use this prevention in the operating system. Q4.&lt;strong&gt;Strategies to Avoid Deadlock in OS&lt;/strong&gt;? &lt;strong&gt;Deadlock Avoidance&lt;/strong&gt;? &lt;strong&gt;(&lt;a href=&quot;https://www.allbca.com/search/label/Operating-System&quot;&gt;Operating System all notes&lt;/a&gt;)&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5SnG4MblClvDk_nmy67w2tW7ozwXrA3gQ9nlT1CfEjy6od1oDvGEjsEAeFaoy-sZSkfxKE9nIqrKlccBvbu959aU7NtOauI7IYCvnt5oXIfv1XCX7jwP5xvdvdTP0DvLaSwj6Ew__Dw/s1600/deadlock-prevention-avoidance-in-os.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;deadlock-prevention-avoidance-in-os&quot; border=&quot;0&quot; data-original-height=&quot;600&quot; data-original-width=&quot;800&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5SnG4MblClvDk_nmy67w2tW7ozwXrA3gQ9nlT1CfEjy6od1oDvGEjsEAeFaoy-sZSkfxKE9nIqrKlccBvbu959aU7NtOauI7IYCvnt5oXIfv1XCX7jwP5xvdvdTP0DvLaSwj6Ew__Dw/s640/deadlock-prevention-avoidance-in-os.webp&quot; title=&quot;deadlock-prevention-avoidance-in-os&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q1. Deadlock Management? or Deadlock in OS?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans. Deadlock in OS:&lt;/strong&gt; A specific sequence of tasks are performed when a process tries to access a resource. First, a process requests the operating system to allocate a resource. If the resource is available, the operating system allocates the resource to that process.&lt;br /&gt;
&lt;br /&gt;
A process can acquire and lock a resource in an exclusive or shareable mode. If a process locks a resource in a shareable mode, the operating system allows other processes to access that resource. But if the process locks a resource in an exclusive mode, no other process is allowed to access that resource.&lt;br /&gt;
&lt;br /&gt;
If all the instances of the requested resource are engaged with other processes, the process waits until an instance of the requested resource becomes free. A process can also request for multiple numbers of instances of a resource but it must be less than the total number of resources available.&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;Example of Deadlock in OS:&lt;/span&gt;&lt;/h3&gt;
If a computer has two printers, no process can request three or more printers. After acquiring the resource, the process utilizes it to perform a specific task.&lt;br /&gt;
&lt;br /&gt;
e.g., In case of scanner usage, a process has to hold a lock on the resource and then use it to scan a document. When the resource is not required, the process releases it, so that the operating system can allocate the resource to any other process.&lt;br /&gt;
&lt;br /&gt;
The above-mentioned procedure occurs in the situation, when there is no deadlock. On the other hand, when a deadlock situation arises, the processes never complete their execution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Q2. Give the four conditions that causes deadlock in OS?&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt; Deadlock Prevention?&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans. Conditions for Deadlock:&lt;/strong&gt; There are four conditions that cause the occurrence of deadlock in os which are as follows:&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;1. Mutual Exclusion:&lt;/span&gt;&lt;/h3&gt;
One or more resources are acquired in an exclusive mode.&lt;br /&gt;
e.g., A process P&lt;sub&gt;1&lt;/sub&gt; locks the resource R in the exclusive mode. This means no other process can acquire the resource R. In other words, the concept of mutual exclusion depicts that a resource can be utilized by one process at a time.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;2. Hold and Wait:&lt;/span&gt;&lt;/h3&gt;
The processes involved in a deadlock acquire at least one resource in exclusive mode and wait for at least another resource that has been acquired by another resources in the exclusive mode.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;3. No Pre-emption:&lt;/span&gt;&lt;/h3&gt;
Processes do not release the resources allotted to them voluntarily without utilizing the resources.&lt;br /&gt;
e.g., The process P&lt;sub&gt;1&lt;/sub&gt; holds the resource R&lt;sub&gt;1&lt;/sub&gt; exclusively and waits for resource R&lt;sub&gt;2&lt;/sub&gt; which is locked by the process P&lt;sub&gt;2&lt;/sub&gt; in the exclusive mode. The concept of no pre-emption denotes the operating system cannot revoke the resource R&lt;sub&gt;1&lt;/sub&gt; from the process P&lt;sub&gt;1&lt;/sub&gt; forcefully.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;4. Circular Wait:&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt; Deadlock Prevention&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
A closed chain or a circular relationship exists among the processes involved in a deadlock.&lt;br /&gt;
e.g., There are three processes P&lt;sub&gt;1&lt;/sub&gt; , P&lt;sub&gt;2&lt;/sub&gt;, and P&lt;sub&gt;3&lt;/sub&gt; . The P&lt;sub&gt;1&lt;/sub&gt; process is waiting for a resource that has been exclusively acquired by the process P&lt;sub&gt;2&lt;/sub&gt; , the process P&lt;sub&gt;2&lt;/sub&gt; is waiting for a resource, which is held exclusively by the process P&lt;sub&gt;3&lt;/sub&gt; and the P&lt;sub&gt;3&lt;/sub&gt; process is waiting for a resource which has been acquired exclusively by the process P&lt;sub&gt;1&lt;/sub&gt; .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;&lt;span style=&quot;color: maroon;&quot;&gt;Q3. Deadlock Prevention? How we use this prevention in the operating system?&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt; Deadlock in OS&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans. Deadlock Prevention:&lt;/strong&gt; Deadlock prevention techniques allocate resources in such a manner that at least one of the four necessary conditions of deadlock cannot occur. It denies at least one of the conditions required for the occurrence of a deadlock. Deadlock prevention techniques do not utilize resource properly.&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;Deadlock Prevention - For Example:&lt;/span&gt;&lt;/h3&gt;
An operating system adopting the deadlock prevention technique allows resources to be pre-empted from a blocked process. No pre-emption condition is violated and deadlock in os does not occur.&lt;br /&gt;
We have known that there are four conditions to be satisfied for the occurrence of a deadlock in os.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;Below is a brief discussion about the deadlock prevention conditions:&lt;/span&gt;&lt;/h3&gt;
&lt;h4&gt;
&lt;span style=&quot;color: purple;&quot;&gt;1. First Condition:&lt;/span&gt;&lt;/h4&gt;
The mutual exclusion condition indicates locking of resources in exclusion, also known as &lt;strong&gt;non-shareable mode&lt;/strong&gt;, which leads to blocking of resources. An operating system can avoid blocking of resources by locking the resources in a shareable mode, if feasible. e.g., Consider two processes that need to read data from a file.&lt;br /&gt;
&lt;br /&gt;
The operating system can allow the locking of that file in a shareable mode by the two processes simultaneously. Some resources can&#39;t be shared by multiple processes. e.g., Two processes can&#39;t simultaneously share a scanner. Again, when a process writes data to a file, it needs to lock the file in an exclusive mode.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
&lt;span style=&quot;color: purple;&quot;&gt;2. Second condition:&lt;/span&gt;&lt;/h4&gt;
&lt;strong&gt;The second condition&lt;/strong&gt; for the occurrence of a deadlock is &lt;strong&gt;hold and wait&lt;/strong&gt;. An operating system can avoid this by adopting a strategy that a process must request for all resources it requires at the same time. This strategy can be implemented in two ways:&lt;br /&gt;
&lt;br /&gt;
Firstly, a process can request all the resources it needs when the execution begins. On the other hand, a process can start execution with a minimum set of resources required and can request other resources when required during the time of execution.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
&lt;span style=&quot;color: purple;&quot;&gt;3. Third condition:&lt;/span&gt;&lt;/h4&gt;
&lt;strong&gt;The third condition&lt;/strong&gt; for deadlock is &lt;strong&gt;no pre-emption&lt;/strong&gt;. An operating system can adopt a policy to avoid this condition. If a process requests for a resource that is unavailable, the process must release all the resources, it has presently acquired and waits for the required resources.&lt;br /&gt;
&lt;br /&gt;
In other words, when a process P requests a busy resource this policy allows other processes to pre-empt the resources currently held by P. There are certain resources, which are good candidates to be pre-empted, CPU, and memory.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
&lt;span style=&quot;color: purple;&quot;&gt;4. Fourth condition:&lt;/span&gt;&lt;/h4&gt;
&lt;strong&gt;The fourth condition&lt;/strong&gt; of deadlock is &lt;strong&gt;circular wait&lt;/strong&gt;. An operating system can impose the ordering of resources for avoiding the circular wait. Resource in a grouped system into certain categories.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #003300;&quot;&gt;&lt;strong&gt;For Example:&lt;/strong&gt;&lt;/span&gt; All magnetic disks from a group and all scanners from another group each category is assigned a number, when a process acquires a resource belonging to a specific category then no other process belonging to a category having a lower number can be claimed.&lt;br /&gt;
&lt;br /&gt;
Formally, if there are n categories of resources in a system, ranging from 0 to n-1 and if a process acquires a resource belonging to category c, then the process can only request a resource belonging to category C +1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q4. Strategies to avoid deadlock in OS? or Deadlock Avoidance?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans. Deadlock Avoidance:&lt;/strong&gt; In deadlock avoidance, an operating system requires additional information in advance about the process, which requires resources, to avoid a deadlock. The fundamental concept of deadlock avoidance is that the operating system only entertains those requests, for resources by processes, which will not lead to a deadlock.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;color: green;&quot;&gt;Deadlock Avoidance:&lt;/span&gt; Banker&#39;s algorithm:&lt;/span&gt;&lt;/h3&gt;
&lt;strong&gt;Banker&#39;s algorithm&lt;/strong&gt; adopts the deadlock avoidance strategy. The name, Banker&#39;s algorithm, depicts the similarity of the concept to the field of banking. A Banker never allots the cash available in such a manner that the Banker cannot fulfill the needs of other clients.&lt;br /&gt;
&lt;br /&gt;
The Banker&#39;s algorithm has two parts such as safety algorithm and resource request algorithm The safety algorithm is applied by an operating system to determine whether or not a system is in a safe state.&lt;br /&gt;
&lt;br /&gt;
The resource request algorithm is applied by an operating system to determine whether or not a request is forwarded by a process. For acquiring a resource would lead the system to an unsafe state.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;Following are the data structures required in the Banker&#39;s algorithm:&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt; Deadlock Avoidance&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;h4&gt;
&lt;span style=&quot;color: #003300;&quot;&gt;1. AVAILABLE: &lt;/span&gt;&lt;/h4&gt;
This is a vector of sizes &#39;s&#39; ranging from AVAILABLE [O] to [s -1]. This vector stores the number of resources available for a specific type.&lt;br /&gt;
&lt;h4&gt;
&lt;span style=&quot;color: #003300;&quot;&gt;2. MAX-DEMAND: &lt;/span&gt;&lt;/h4&gt;
This is a matrix having &#39;t&#39; number of rows and s number of columns. When a process begins its execution, it has to state the operating system that how many instances of a resource it may require during its execution.&lt;br /&gt;
&lt;h4&gt;
&lt;span style=&quot;color: #003300;&quot;&gt;3. ALLOCATION: &lt;/span&gt;&lt;/h4&gt;
This is a matrix having t number of rows and s number of columns. This matrix stores the number of instances of a resource allocated to a process. e.g., ALLOCATION [x,&amp;nbsp; y]=4 indicates that 4 instances of the resources R&lt;sub&gt;y&lt;/sub&gt; have been allocated to the process P&lt;sub&gt;x&lt;/sub&gt; . The set of all resources allocated to the process P&lt;sub&gt;x&lt;/sub&gt;&amp;nbsp; can be depicted as a vector, ALLOCATION x.&lt;br /&gt;
&lt;h4&gt;
&lt;span style=&quot;color: #003300;&quot;&gt;4. NEED: &lt;/span&gt;&lt;/h4&gt;
This is a matrix having &#39;t&#39; number of rows and &#39;s&#39; number of columns. This indicates the number of instances of a resource presently required by a process to complete the process.&lt;br /&gt;
&lt;h4&gt;
&lt;span style=&quot;color: #003300;&quot;&gt;5. WORK: &lt;/span&gt;&lt;/h4&gt;
This is a vector of size &#39;t&#39;, for storing information about the resources temporarily.&lt;br /&gt;
&lt;h4&gt;
&lt;span style=&quot;color: #003300;&quot;&gt;6. FINISHED: &lt;/span&gt;&lt;/h4&gt;
This is a vector of size &#39;t&#39; for determining whether or not a process is complete.&lt;br /&gt;
&lt;h4&gt;
&lt;span style=&quot;color: #003300;&quot;&gt;7. CLAIMS: &lt;/span&gt;&lt;/h4&gt;
This is a matrix of the dimension, &#39;t&#39; number of rows and ‘s&#39; number of columns. CLAIMS [x,&amp;nbsp; y]=4 means that the process P&lt;sub&gt;x&lt;/sub&gt; sends a request to the operating system to grant 4 instances of the resource R&lt;sub&gt;y&lt;/sub&gt; .&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;The second part of Banker&#39;s algorithm&lt;/strong&gt;, known as the resource request algorithm determines whether granting a resource according to any claim by a process leads to an unsafe state or not. This algorithm is applied when a process sends a request to grant one or a set of resources.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: #003366;&quot;&gt;&lt;span style=&quot;color: #003366;&quot;&gt;Advantages:&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt; Deadlock Avoidance&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
The advantages of Banker&#39;s algorithm are that it allows mutual exclusion, hold and wait, and no pre-emption conditions. The system assures that a process will be allocated the resources without deadlock.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: #003366;&quot;&gt;&lt;span style=&quot;color: #003366;&quot;&gt;Disadvantages:&lt;/span&gt;&lt;span style=&quot;color: white;&quot;&gt; Deadlock Avoidance&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
The disadvantages of Banker&#39;s algorithm is the overhead of simulation and calculation, each time a process requests for a resource. The deadlock avoidance techniques can&#39;t be applied until an operating system knows the resource requirement of a process in advance.&lt;br /&gt;
&lt;br /&gt;
This approach may lead to a process of starvation while waiting for a long time to get the requested resources allocated by the operating system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Join us on Facebook, Instagram, and Twitter to get the latest study material. You can also ask us any questions.&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;Facebook =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;a href=&quot;https://www.fb.com/allbcaweb&quot; rel=&quot;nofollow&quot; style=&quot;color: blue;&quot;&gt;@allbcaweb&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Facebook)&lt;br /&gt;
&lt;b&gt;Instagram&lt;/b&gt; = &lt;a href=&quot;https://www.instagram.com/allbcaweb/&quot; rel=&quot;nofollow noopener noreferrer&quot; target=&quot;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;@allbcaweb&lt;/b&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Instagram)&lt;br /&gt;
&lt;strong&gt;Twitter =&amp;nbsp;&lt;span style=&quot;color: #00ccff;&quot;&gt;&lt;a href=&quot;https://www.twitter.com/allbcaweb&quot; rel=&quot;nofollow&quot; style=&quot;color: #00ccff;&quot;&gt;@allbcaweb&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Twitter)&lt;br /&gt;
&lt;b&gt;Email=&amp;nbsp;&lt;a href=&quot;mailto:allbca.com@gmail.com&quot;&gt;allbca.com@gmail.com&lt;/a&gt;&lt;br /&gt;Send us your query anytime about Deadlock in OS!&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: #993366;&quot;&gt;External Links:-&lt;/span&gt;&lt;/h3&gt;
1. Deadlock in OS - (&lt;a href=&quot;https://www.geeksforgeeks.org/introduction-of-deadlock-in-operating-system/&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
2. Deadlock Prevention - (&lt;a href=&quot;https://www.geeksforgeeks.org/deadlock-prevention/&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
3. Deadlock Avoidance - (&lt;a href=&quot;https://www.javatpoint.com/os-deadlock-avoidance&quot;&gt;click here&lt;/a&gt;)&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/8140082042503403013'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/8140082042503403013'/><link rel='alternate' type='text/html' href='https://www.allbca.com/2020/04/deadlock-prevention-avoidance-in-os.html' title='Deadlock in OS - Deadlock Prevention, Deadlock Avoidance'/><author><name>Mayank Rana</name><uri>http://www.blogger.com/profile/06163424302596650438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs9mOMQbRjoNrVnY7AbBycXEpeOG7szPXA2y_RbbeTVJ25GEGpq6q-gZxcoKqROoy4G51CI9ZCvXhjBXCUH8gb-MvrIfJnbBBdt4BY6sgH3zI2blMucgSoV-XQYw6d9g/s125/mayankrana.webp'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5SnG4MblClvDk_nmy67w2tW7ozwXrA3gQ9nlT1CfEjy6od1oDvGEjsEAeFaoy-sZSkfxKE9nIqrKlccBvbu959aU7NtOauI7IYCvnt5oXIfv1XCX7jwP5xvdvdTP0DvLaSwj6Ew__Dw/s72-c/deadlock-prevention-avoidance-in-os.webp" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-5313576602653501716.post-2309752986770040515</id><published>2020-04-24T23:32:00.000+05:30</published><updated>2020-04-24T23:51:17.149+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer-Graphics"/><title type='text'>Hard Copy Devices in computer graphics | Technology</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;a href=&quot;https://www.allbca.com/2020/03/Computer-Graphics-Multimedia-Application-CGMA.html&quot;&gt;&lt;strong&gt;Computer Graphics and Multimedia Application&lt;/strong&gt;&lt;/a&gt;: Q1.&lt;strong&gt;What is Hard Copy Technology&lt;/strong&gt;? &lt;strong&gt;Explain the Hard Copy Devices&lt;/strong&gt;?&amp;nbsp;&lt;strong&gt;(&lt;a href=&quot;https://www.allbca.com/search/label/Computer-Graphics&quot;&gt;Computer graphics and multimedia application All Notes&lt;/a&gt;)&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmk4lMAj_QRhHTct-hzIvEOwCRIKh-OW6b22LEmxw3YR5yQ9od18rWtX6pq7Hn7bwlCdMW-Ebdnz47eBUe_9_fMOxca5sqAefFRaA5OmxJsUXLCJwxrmJmATT0O1i5957SJ6wz-pohuA/s1600/hard-copy-devices-in-computer-graphics.webp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;hard-copy-devices-in-computer-graphics&quot; border=&quot;0&quot; data-original-height=&quot;600&quot; data-original-width=&quot;800&quot; height=&quot;480&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmk4lMAj_QRhHTct-hzIvEOwCRIKh-OW6b22LEmxw3YR5yQ9od18rWtX6pq7Hn7bwlCdMW-Ebdnz47eBUe_9_fMOxca5sqAefFRaA5OmxJsUXLCJwxrmJmATT0O1i5957SJ6wz-pohuA/s640/hard-copy-devices-in-computer-graphics.webp&quot; title=&quot;hard-copy-devices-in-computer-graphics&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;span style=&quot;color: maroon;&quot;&gt;Q1. What is Hard Copy Technology? Explain the Hard Copy Devices?&lt;/span&gt;&lt;/h2&gt;
&lt;strong&gt;Ans.&lt;/strong&gt; We can obtain hard-copy output for our data (text, image, etc) in several formats. For presentation, we can send image file to device that will produce 35 mm slides or transparencies. To put images on film, we can simply photograph a scene displayed on a video monitor. And we can put our pictures on paper by directing graphics output to a printer.&lt;br /&gt;
&lt;br /&gt;
The quality of the picture obtained from a device depends on dot size and the number of dot per inch, or lines per inch, that can be displayed. To produce smooth characters on printed text string, higher quality printers shift dot positions so that adjacent dots overlap.&lt;br /&gt;
&lt;br /&gt;
Printers produce output by either impact or non-impact methods. &lt;strong&gt;Impact printers&lt;/strong&gt; press formed character face against an inked ribbon unto paper. A line printer is an example of an impact printer (device). &lt;strong&gt;Non-impact printers&lt;/strong&gt; and plotters use laser technology, ink-jet sprays, xerographics, electrostatic method and electro thermal method to get image onto paper.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Character impact printer&lt;/strong&gt; often have a dot matrix paint head containing a rectangular array of protruding wire pin, with the number of pin depending on the quality of printer. Individual characters or graphics patterns are obtained by retracting certain pins so that remaining pin from the pattern to be printed.&lt;br /&gt;
&lt;br /&gt;
In a &lt;strong&gt;laser device&lt;/strong&gt;, a laser beam creates a charge distribution on a rotating drum coated with a photoelectrical matrial such as selenium. Toner is applied to the drum and then transferred to paper.&lt;br /&gt;
&lt;strong&gt;Ink-jet&lt;/strong&gt; method produces output by filling ink in horizontal rows across a roll paper wrapped on a drum. The electrically charged ink stream is deflected by an electric field to produce dot matrix pattern.&lt;br /&gt;
&lt;br /&gt;
An &lt;strong&gt;electrostatic device&lt;/strong&gt; places a negative charge on the paper, one completed row at a time along the length of paper. Then, the paper is exposed to a toner. The toner is positively charged and so attracted to the negatively charged area where it adheres to produce specified output.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;[ Topic= Hard Copy Devices in computer graphics ]&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: white;&quot;&gt;[ Topic= Hard Copy Devices in computer graphics ]&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Join us on Facebook, Instagram, and Twitter to get the latest study material. You can also ask us any questions.&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;Facebook =&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;&lt;a href=&quot;https://www.fb.com/allbcaweb&quot; rel=&quot;nofollow&quot; style=&quot;color: blue;&quot;&gt;@allbcaweb&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Facebook)&lt;br /&gt;
&lt;b&gt;Instagram&lt;/b&gt; = &lt;a href=&quot;https://www.instagram.com/allbcaweb/&quot; rel=&quot;nofollow noopener noreferrer&quot; target=&quot;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;@allbcaweb&lt;/b&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Instagram)&lt;br /&gt;
&lt;strong&gt;Twitter =&amp;nbsp;&lt;span style=&quot;color: #00ccff;&quot;&gt;&lt;a href=&quot;https://www.twitter.com/allbcaweb&quot; rel=&quot;nofollow&quot; style=&quot;color: #00ccff;&quot;&gt;@allbcaweb&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
(click on it or search &quot;allbcaweb&quot; on Twitter)&lt;br /&gt;
&lt;b&gt;Email=&amp;nbsp;&lt;a href=&quot;mailto:allbca.com@gmail.com&quot;&gt;allbca.com@gmail.com&lt;/a&gt;&lt;br /&gt;Send us your query anytime about Hard Copy Devices in computer graphics!&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span style=&quot;color: #993366;&quot;&gt;External Links:-&lt;/span&gt;&lt;/h3&gt;
1. Hard Copy Devices in computer graphics - (&lt;a href=&quot;https://www.academia.edu/5273524/Hard_copy_devices_Hard_copy_devices&quot; target=&quot;_blank&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
2. Hard Copy Devices in computer graphics - (&lt;a href=&quot;https://www.javatpoint.com/computer-graphics-output-devices&quot; target=&quot;_blank&quot;&gt;click here&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: white;&quot;&gt;[ Topic= Hard Copy Devices in computer graphics ]&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;[ Topic= Hard Copy Devices in computer graphics ]&lt;/b&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/2309752986770040515'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/5313576602653501716/posts/default/2309752986770040515'/><link rel='alternate' type='text/html' href='https://www.allbca.com/2020/04/hard-copy-devices-in-computer-graphics.html' title='Hard Copy Devices in computer graphics | Technology'/><author><name>Mayank Rana</name><uri>http://www.blogger.com/profile/06163424302596650438</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='29' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs9mOMQbRjoNrVnY7AbBycXEpeOG7szPXA2y_RbbeTVJ25GEGpq6q-gZxcoKqROoy4G51CI9ZCvXhjBXCUH8gb-MvrIfJnbBBdt4BY6sgH3zI2blMucgSoV-XQYw6d9g/s125/mayankrana.webp'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmk4lMAj_QRhHTct-hzIvEOwCRIKh-OW6b22LEmxw3YR5yQ9od18rWtX6pq7Hn7bwlCdMW-Ebdnz47eBUe_9_fMOxca5sqAefFRaA5OmxJsUXLCJwxrmJmATT0O1i5957SJ6wz-pohuA/s72-c/hard-copy-devices-in-computer-graphics.webp" height="72" width="72"/></entry></feed>