SlideShare a Scribd company logo
1 of 14
A Presentation On
I/O-Buffering
Department Of Information Technology
Year(2017-18)
Guided By:-
Department Of Information Technology
RAJKIYA ENGINEERING COLLEGE,DEOGAON
AZAMGARH (U P)-276201 (INDIA)
Presented By:-
Name : Nikhil Gupta
Department Of Information Technology
Contents
 I/O Buffering
 Types Of I/O Devices
 No Buffering
 User Level Buffering
 Types of buffering
 Single Buffering
 Double Buffering
 Circular Buffering
 Utility Of Buffering
 Conclusion
 References
I/O Buffering
 A process of storing data in memory area called Buffers while data is being
transferred between two devices or between a device and an application.
 I/O buffering The process of temporarily storing data that is passing between a
processor and a peripheral. The usual purpose is to smooth out the difference in rates
at which the two devices can handle data.
 Input/output (I/O) buffering is a mechanism that improves the throughput of input
and output operations. It is implemented directly in hardware and the corresponding
drivers (hence the block devices found in Unix-like systems)
Buffering is done due to 3 reason
a) To cope with the speed mismatch between producer (or sender) and consumer (or
receiver) of a data stream.
b) To adapt between the devices having different data-transfer size.
c) To support copy semantics for application I/O.
Types Of I/O Devices
1.Block-oriented Devices :-All I/O devices are classified as either character or block
devices. With block devices data is transferred in a block of bytes and required a
buffering mechanism to allow faster input and output operations. Also, block devices
accept input and output only in blocks. E.g. (hard drives, floppy disks, and optical
drives such as DVD-ROM, and CD-ROM)
2.Stream-oriented:-character devices (also called stream of bytes devices) transfer data
in a few streams of bytes. Such devices don’t required buffering mechanism, and
they don’t operate with a fixed block size
No Buffering
 Process must read/write a device a byte/word a time.
 Each individual system call adds significant overhead.
 Process must what until each I/O is complete.
i) Blocking/waking adds to overhead
ii) Many short run of a process is inefficient.
 What happens if buffer is paged out to disk.
i) Could lose data while buffer is paged in
ii) Could lock buffer in memory (needed for DMA), however many processes
doing I/O reduce RAM available for paging.
iii) Can cause deadlock as RAM is limited resource.
Fig no. - 01
User Level buffering
 User process can process one block of data while next block is read in.
 Swapping can occur since input is taking place in system memory, not user
memory.
 Operating system keeps track of assignment of system buffers to user processes.
Assume:
– T is transfer time for a block from device
– C is computation time to process incoming block
– M is time to copy kernel buffer to user buffer
 Computation and transfer can be done in parallel.
 Without buffering: Execution time is T+C.
 With buffering: Execution time is max [C,T]+M, where M is time required to move
the data from system buffer to user memory.

User Level buffering
 Process specifies a memory buffer that incoming data is placed in until it fills.
– Filling can be done by interrupt service routine.
– Only a single system call, and block/wakeup per data buffer.
 Much more efficient.
 When is buffer available for re-use?
– Either process must block until potential slow device drains buffer
– OR deal with asynchronous signals indicating buffer drained
Single Level Buffering
 Operating system assigns a buffer in Kernel’s memory for an I/O request .
 Stream Oriented
i) Used a line at time.
ii) User input from a terminal with carriage return signaling the end of the line.
iii) Output to the terminal is one line at a time.
 Block-oriented
i) Input transfers made to buffer
ii) Block moved to user space when needed.
iii) Another block is moved into the buffer.(Read ahead)
Fig no. - 02
Double Level Buffering
 Use two system buffers instead of one.
 A process can transfer data to or from one buffer while the operating system
empties or fills the other buffer.
 Computation and Memory copy can be done in parallel with transfer.
 May be insufficient for really burst traffic.
– Lots of application writes between long periods of computation
– Long periods of application computation while receiving data
– Might want to read-ahead more than a single block for disk
Fig no. - 03
Circular Level Buffering
 More than two buffers are used.
 Each individual buffer is one unit in a circular buffer.
 Used when I/O operation must keep up with process.
 Double buffering may be inadequate if the process performs rapid bursts of I/O.
 The problem can often be alleviated by using more than two buffers.
 When more than two buffers are used, the collection of buffers is itself referred to as
a circular buffer with each individual buffer being one unit in the circular buffer.
Fig no. - 04
Utility Of Buffering
 Buffering is a technique that smoothest out peaks in I/O demand. However, no
amount of buffering will allow an I/O device to keep pace with a process indefinitely
when the average demand of the process is greater than the I/O device can service. If
offline operation after the data has been read and the CPU is operated on it the
magnetic tapes are instructed to store the next input into some reserve memory are
a called buffer.
Buffering is done for 3 reasons
-To cope with the speed mismatch between producer (or sender) and consumer
(or receiver) of a data stream.
-To adapt between devices having different data.
-Transfer size-To support copy semantics for application I/O.
Conclusion
 The time taken to complete a job is faster but the CPU is more utilized as the access
time from memory to the CPU is faster than the access time from any I/O device to
the CPU.
 Buffering overlaps I/O of a job with job’s computations. In a multiple programming
environment, when there is a variety of I/O activity and a variety of process activity
to service, buffering is one tool that can increase the efficiency the OS and
the performance of individual processes.
References
 [1].[ONLINE].[AVAILABLE].www.wcipeg.com/wiki/I/Obuffering.
 [1].[ONLINE].[AVAILABLE].www.cs.helsinki.fi/u/kerola/kj2/stal-01.
 [1].[ONLINE].[AVAILABLE].www.sci.brooklyn.cuny.edu/~jniu/teachering/csc3
3200.
 [1].[ONLINE].[AVAILABLE].www.lighter.guthub.io/CudaDMA/buffering.
 [1].[ONLINE].[AVAILABLE].www.opengl.org/discussion_boards/...php/197778-
single-vs-double-buffering
G143

More Related Content

What's hot (20)

Chapter 5
Chapter 5Chapter 5
Chapter 5
 
Computer Architecture and organization
Computer Architecture and organizationComputer Architecture and organization
Computer Architecture and organization
 
Parallel Processors (SIMD)
Parallel Processors (SIMD) Parallel Processors (SIMD)
Parallel Processors (SIMD)
 
Chapter 10
Chapter 10Chapter 10
Chapter 10
 
CS6303 - Computer Architecture
CS6303 - Computer ArchitectureCS6303 - Computer Architecture
CS6303 - Computer Architecture
 
Operating systems types, spooling and buffering
Operating systems types, spooling and bufferingOperating systems types, spooling and buffering
Operating systems types, spooling and buffering
 
Unit 5 Advanced Computer Architecture
Unit 5 Advanced Computer ArchitectureUnit 5 Advanced Computer Architecture
Unit 5 Advanced Computer Architecture
 
Ch13
Ch13Ch13
Ch13
 
M1 rl 1.1.1
M1 rl 1.1.1M1 rl 1.1.1
M1 rl 1.1.1
 
Ch8
Ch8Ch8
Ch8
 
Memory interleaving and superscalar processor
Memory interleaving and superscalar processorMemory interleaving and superscalar processor
Memory interleaving and superscalar processor
 
OSCh14
OSCh14OSCh14
OSCh14
 
main memory
main memorymain memory
main memory
 
1.prallelism
1.prallelism1.prallelism
1.prallelism
 
Stored program concept
Stored program conceptStored program concept
Stored program concept
 
CO Module 5
CO Module 5CO Module 5
CO Module 5
 
Cse viii-advanced-computer-architectures-06cs81-solution
Cse viii-advanced-computer-architectures-06cs81-solutionCse viii-advanced-computer-architectures-06cs81-solution
Cse viii-advanced-computer-architectures-06cs81-solution
 
Main Memory - Part2
Main Memory - Part2Main Memory - Part2
Main Memory - Part2
 
Memory organization (Computer architecture)
Memory organization (Computer architecture)Memory organization (Computer architecture)
Memory organization (Computer architecture)
 
hierarchical bus system
 hierarchical bus system hierarchical bus system
hierarchical bus system
 

Similar to G143

Slide combine
Slide combineSlide combine
Slide combineBluecn
 
Unit vos - File systems
Unit vos - File systemsUnit vos - File systems
Unit vos - File systemsdonny101
 
Ch 7 io_management & disk scheduling
Ch 7 io_management & disk schedulingCh 7 io_management & disk scheduling
Ch 7 io_management & disk schedulingmadhuributani
 
Os files 2
Os files 2Os files 2
Os files 2Amit Pal
 
Advanced computer architecture
Advanced computer architectureAdvanced computer architecture
Advanced computer architectureAjithaSomasundaram
 
Ch2_Processes_and_process_management_1.ppt
Ch2_Processes_and_process_management_1.pptCh2_Processes_and_process_management_1.ppt
Ch2_Processes_and_process_management_1.pptMohammad Almuiet
 
I/o management and disk scheduling .pptx
I/o management and disk scheduling .pptxI/o management and disk scheduling .pptx
I/o management and disk scheduling .pptxwebip34973
 
03 Data Recovery - Notes
03 Data Recovery - Notes03 Data Recovery - Notes
03 Data Recovery - NotesKranthi
 
Lecture1,2,3 (1).pdf
Lecture1,2,3 (1).pdfLecture1,2,3 (1).pdf
Lecture1,2,3 (1).pdfTaufeeq8
 
Operating system (BCS303) MODULE 1 NOTES
Operating system (BCS303) MODULE 1 NOTESOperating system (BCS303) MODULE 1 NOTES
Operating system (BCS303) MODULE 1 NOTESKopinathMURUGESAN
 
operating system over view.ppt operating sysyems
operating system over view.ppt operating sysyemsoperating system over view.ppt operating sysyems
operating system over view.ppt operating sysyemsJyoReddy9
 
Introduction to Operating System (Important Notes)
Introduction to Operating System (Important Notes)Introduction to Operating System (Important Notes)
Introduction to Operating System (Important Notes)Gaurav Kakade
 
OS - Ch1
OS - Ch1OS - Ch1
OS - Ch1sphs
 
Chapter 1 - Introduction
Chapter 1 - IntroductionChapter 1 - Introduction
Chapter 1 - IntroductionWayne Jones Jnr
 
Operating systems. replace ch1 with numbers for next chapters
Operating systems. replace ch1 with numbers for next chaptersOperating systems. replace ch1 with numbers for next chapters
Operating systems. replace ch1 with numbers for next chapterssphs
 

Similar to G143 (20)

Buffering.pptx
Buffering.pptxBuffering.pptx
Buffering.pptx
 
Slide combine
Slide combineSlide combine
Slide combine
 
I/O Organization
I/O OrganizationI/O Organization
I/O Organization
 
Unit vos - File systems
Unit vos - File systemsUnit vos - File systems
Unit vos - File systems
 
Ch 7 io_management & disk scheduling
Ch 7 io_management & disk schedulingCh 7 io_management & disk scheduling
Ch 7 io_management & disk scheduling
 
Os files 2
Os files 2Os files 2
Os files 2
 
Advanced computer architecture
Advanced computer architectureAdvanced computer architecture
Advanced computer architecture
 
Ch2_Processes_and_process_management_1.ppt
Ch2_Processes_and_process_management_1.pptCh2_Processes_and_process_management_1.ppt
Ch2_Processes_and_process_management_1.ppt
 
I/o management and disk scheduling .pptx
I/o management and disk scheduling .pptxI/o management and disk scheduling .pptx
I/o management and disk scheduling .pptx
 
03 Data Recovery - Notes
03 Data Recovery - Notes03 Data Recovery - Notes
03 Data Recovery - Notes
 
IO system
IO systemIO system
IO system
 
Lecture1,2,3 (1).pdf
Lecture1,2,3 (1).pdfLecture1,2,3 (1).pdf
Lecture1,2,3 (1).pdf
 
Operating system (BCS303) MODULE 1 NOTES
Operating system (BCS303) MODULE 1 NOTESOperating system (BCS303) MODULE 1 NOTES
Operating system (BCS303) MODULE 1 NOTES
 
Ch1
Ch1Ch1
Ch1
 
operating system over view.ppt operating sysyems
operating system over view.ppt operating sysyemsoperating system over view.ppt operating sysyems
operating system over view.ppt operating sysyems
 
Introduction to Operating System (Important Notes)
Introduction to Operating System (Important Notes)Introduction to Operating System (Important Notes)
Introduction to Operating System (Important Notes)
 
OS - Ch1
OS - Ch1OS - Ch1
OS - Ch1
 
Chapter 1 - Introduction
Chapter 1 - IntroductionChapter 1 - Introduction
Chapter 1 - Introduction
 
Operating systems. replace ch1 with numbers for next chapters
Operating systems. replace ch1 with numbers for next chaptersOperating systems. replace ch1 with numbers for next chapters
Operating systems. replace ch1 with numbers for next chapters
 
OS_Ch2
OS_Ch2OS_Ch2
OS_Ch2
 

Recently uploaded

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxakanksha16arora
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Play hard learn harder: The Serious Business of Play
Play hard learn harder:  The Serious Business of PlayPlay hard learn harder:  The Serious Business of Play
Play hard learn harder: The Serious Business of PlayPooky Knightsmith
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17Celine George
 
Economic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesEconomic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesSHIVANANDaRV
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptxJoelynRubio1
 
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfUGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfNirmal Dwivedi
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfstareducators107
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfPondicherry University
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 

Recently uploaded (20)

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Play hard learn harder: The Serious Business of Play
Play hard learn harder:  The Serious Business of PlayPlay hard learn harder:  The Serious Business of Play
Play hard learn harder: The Serious Business of Play
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17
 
Economic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesEconomic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food Additives
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfUGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdf
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 

G143

  • 1. A Presentation On I/O-Buffering Department Of Information Technology Year(2017-18) Guided By:- Department Of Information Technology RAJKIYA ENGINEERING COLLEGE,DEOGAON AZAMGARH (U P)-276201 (INDIA) Presented By:- Name : Nikhil Gupta Department Of Information Technology
  • 2. Contents  I/O Buffering  Types Of I/O Devices  No Buffering  User Level Buffering  Types of buffering  Single Buffering  Double Buffering  Circular Buffering  Utility Of Buffering  Conclusion  References
  • 3. I/O Buffering  A process of storing data in memory area called Buffers while data is being transferred between two devices or between a device and an application.  I/O buffering The process of temporarily storing data that is passing between a processor and a peripheral. The usual purpose is to smooth out the difference in rates at which the two devices can handle data.  Input/output (I/O) buffering is a mechanism that improves the throughput of input and output operations. It is implemented directly in hardware and the corresponding drivers (hence the block devices found in Unix-like systems) Buffering is done due to 3 reason a) To cope with the speed mismatch between producer (or sender) and consumer (or receiver) of a data stream. b) To adapt between the devices having different data-transfer size. c) To support copy semantics for application I/O.
  • 4. Types Of I/O Devices 1.Block-oriented Devices :-All I/O devices are classified as either character or block devices. With block devices data is transferred in a block of bytes and required a buffering mechanism to allow faster input and output operations. Also, block devices accept input and output only in blocks. E.g. (hard drives, floppy disks, and optical drives such as DVD-ROM, and CD-ROM) 2.Stream-oriented:-character devices (also called stream of bytes devices) transfer data in a few streams of bytes. Such devices don’t required buffering mechanism, and they don’t operate with a fixed block size
  • 5. No Buffering  Process must read/write a device a byte/word a time.  Each individual system call adds significant overhead.  Process must what until each I/O is complete. i) Blocking/waking adds to overhead ii) Many short run of a process is inefficient.  What happens if buffer is paged out to disk. i) Could lose data while buffer is paged in ii) Could lock buffer in memory (needed for DMA), however many processes doing I/O reduce RAM available for paging. iii) Can cause deadlock as RAM is limited resource. Fig no. - 01
  • 6. User Level buffering  User process can process one block of data while next block is read in.  Swapping can occur since input is taking place in system memory, not user memory.  Operating system keeps track of assignment of system buffers to user processes. Assume: – T is transfer time for a block from device – C is computation time to process incoming block – M is time to copy kernel buffer to user buffer  Computation and transfer can be done in parallel.  Without buffering: Execution time is T+C.  With buffering: Execution time is max [C,T]+M, where M is time required to move the data from system buffer to user memory. 
  • 7. User Level buffering  Process specifies a memory buffer that incoming data is placed in until it fills. – Filling can be done by interrupt service routine. – Only a single system call, and block/wakeup per data buffer.  Much more efficient.  When is buffer available for re-use? – Either process must block until potential slow device drains buffer – OR deal with asynchronous signals indicating buffer drained
  • 8. Single Level Buffering  Operating system assigns a buffer in Kernel’s memory for an I/O request .  Stream Oriented i) Used a line at time. ii) User input from a terminal with carriage return signaling the end of the line. iii) Output to the terminal is one line at a time.  Block-oriented i) Input transfers made to buffer ii) Block moved to user space when needed. iii) Another block is moved into the buffer.(Read ahead) Fig no. - 02
  • 9. Double Level Buffering  Use two system buffers instead of one.  A process can transfer data to or from one buffer while the operating system empties or fills the other buffer.  Computation and Memory copy can be done in parallel with transfer.  May be insufficient for really burst traffic. – Lots of application writes between long periods of computation – Long periods of application computation while receiving data – Might want to read-ahead more than a single block for disk Fig no. - 03
  • 10. Circular Level Buffering  More than two buffers are used.  Each individual buffer is one unit in a circular buffer.  Used when I/O operation must keep up with process.  Double buffering may be inadequate if the process performs rapid bursts of I/O.  The problem can often be alleviated by using more than two buffers.  When more than two buffers are used, the collection of buffers is itself referred to as a circular buffer with each individual buffer being one unit in the circular buffer. Fig no. - 04
  • 11. Utility Of Buffering  Buffering is a technique that smoothest out peaks in I/O demand. However, no amount of buffering will allow an I/O device to keep pace with a process indefinitely when the average demand of the process is greater than the I/O device can service. If offline operation after the data has been read and the CPU is operated on it the magnetic tapes are instructed to store the next input into some reserve memory are a called buffer. Buffering is done for 3 reasons -To cope with the speed mismatch between producer (or sender) and consumer (or receiver) of a data stream. -To adapt between devices having different data. -Transfer size-To support copy semantics for application I/O.
  • 12. Conclusion  The time taken to complete a job is faster but the CPU is more utilized as the access time from memory to the CPU is faster than the access time from any I/O device to the CPU.  Buffering overlaps I/O of a job with job’s computations. In a multiple programming environment, when there is a variety of I/O activity and a variety of process activity to service, buffering is one tool that can increase the efficiency the OS and the performance of individual processes.
  • 13. References  [1].[ONLINE].[AVAILABLE].www.wcipeg.com/wiki/I/Obuffering.  [1].[ONLINE].[AVAILABLE].www.cs.helsinki.fi/u/kerola/kj2/stal-01.  [1].[ONLINE].[AVAILABLE].www.sci.brooklyn.cuny.edu/~jniu/teachering/csc3 3200.  [1].[ONLINE].[AVAILABLE].www.lighter.guthub.io/CudaDMA/buffering.  [1].[ONLINE].[AVAILABLE].www.opengl.org/discussion_boards/...php/197778- single-vs-double-buffering