Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Slide combine
1. NURUL NAIM BINTI ABDULLAH SANI B031210190
MOHD SHAZWAN BIN KAMARUDIN DARUS B031210196
FIRDHAUSADNIN BIN RAHMAT B031210378
CHONG CAI NING B031210080
2. Input Output Buffering
There is a speed mismatch between I/O
devices and CPU.
This leads to inefficiency in processes being
completed.
To increase the efficiency, it may be
convenient to perform input transfers in
advance of requests being made and to
perform output transfers some time after the
request is made.
This technique is known as buffering
3. Input Output Buffering
In discussing the various approaches to
buffering, it is sometimes important to make
a distinction between two types of I/O
devices:
Block-oriented devices store information in blocks
that are usually of fixed size and transfers are
made one block at a time for example disk,tape
Stream-oriented devices transfer data in and out
as a stream of bytes, with no block structure for
example terminals, printers, communications
port, mouse.
4. What is single buffer ??
Operating system assigns a buffer in main
memory for an I/O request
Example when a user process issues an I/O
request, the operating system assigns a buffer in
the system portion of main memory to the
operation
5. Single buffer process
The simplest type of buffering is single buffering.
When a user process issues and I/O request, the
operating system assigns a buffer in the system
portion of main memory to the operation.
For block-oriented devices, the single buffering
scheme can be described as follows: Input
transfers are made to the system buffer.
When the transfer is complete, the process moves
the block into user space and immediately
requests another block.
6. For stream oriented I/O, the single buffering
scheme can be used in a line- at- a time Fashion
or a byte-at-a-time fashion.
In line-at-a-time fashion user input and output
to the terminal is one line at a time. For eg.
Scroll-mode terminals, line printer.
Suppose thatT is required to input one block and
that C is the computation time.
single buffer : you read and write on the same
buffer, can be messy if both reading and writing
take place at the same time.
Single buffer process
7. What is double buffer ?
Two buffers are used for the I/O operation .It’s
also the process uses the content of one buffer
while the I/O device uses the other.
Double-buffering possibly sounds harder than it
actually is.
8. ADVANTAGES
The user does not see every pixel modification
(so if the same pixel gets modified 5 times, the
user will only see the last one).This helps
preventing 'flickering' (or screen flashes).
Double-buffering usually takes care of artifacts
you or the user might be experiencing.
Writing to video memory is only performed
once, on the buffer swap, instead of repeatedly
for every pixel of which some might be
overlapped later and might be invisible.
9. DISADVANTAGES
Even though double-buffering
is useful, it also has negative
characteristics. Each is listed
with an explanation and a
possible solution.
11. Circular Buffering
When more than 2 buffers are used
-- each individual buffer is one unit in the circular
buffer…
Is used when…
--double buffering may be not enough if process
perform rapid bursts of I/O…
Therefore, this type of buffering is needed for
keeping up with the process
12. Circular buffer of a process
used for data transfer between 2 processes.
Producer process: place item into circular buffer
Consumer process: remove the item
Variable capacity of circular buffer accommodate
time ≠ producer and consumer process…
--can execute faster than the other queue that hold a
variable amount of data since…
A fixed size block of memory is allocated just once
from memory management and then reused.
13. -- often is used to decouple 2 processes that
operate at different speeds…
-> fast producer process:
--- can “burst” data into buffer and then
continue with its processing
-> slower consumer process:
--- can read the data with its own rate without
synchronizing and slowing the producer.
Circular buffer of a process
14. -the average rate, over time, of both
producer and consumer process must be
same to avoid over or underflow of
condition of the circular buffering
(“Synchronize Mode “ of operation)
Circular buffer of a process
15. --- 2 methods can avoid data loss
in synchronize mode
--- 2 methods can avoid data loss in synchronize mode:
a) Calling blocking method:
calling thread to block until the Circular buffer has
the requested number of items.
b) WaterMark method:
fire an event when the number of items in the
circular buffer reaches a preset level…
~~ eliminating wasting processing time due to
process block.