Modes of Processing - Bangor Grammar School

Download Report

Transcript Modes of Processing - Bangor Grammar School

System Software
AS ICT 1.2.5
Software
There are 2 broad types of software:
• Application software
– word processing and DTP packages
– spreadsheet and database packages
– sound/video/animation editors
– web design packages
– graphics packages
• System software
– controls and monitors the running of
application programs
– allows users to communicate with the
computer’s hardware
Software
System software
• System software manages the resources of the
computer
• . . . at a low level/at hardware level, e.g. internal
and external memory
• It includes the operating system
• . . . and utility programs
• . . . such as compilers, loaders, linkers and
debuggers
• It provides the user interface
• Programs would be too complex to create if we had
to micro-manage all of the memory ourselves
Utility programs
• File compressors – to reduce storage space requirements
• Device drivers – Operating systems rely on these for
controlling hardware
• File management utilities – attempt to repair corrupted files,
reorganise files to ‘defragment’ the memory
• Virus checkers – check disks and memory for viruses and
delete them if detected.
• Security and accounting software – checks user IDs and
passwords, counts and reports the number of attempts made
to log on under each user ID, the amount of processor time
used at each session, total login time etc.
• Programming tools – compilers, loaders, linkers and
debuggers
Utility programs: Drivers
• Printer drivers are used to control the printer’s
functioning
• Each type of printer requires its own driver
• Printers work at speeds much slower than the
processor and the two must work as a coherent unit
so that data may be transferred from the computer
to the printer
Operating systems
•
•
•
•
•
DOS
Windows 95, NT, XP, 7
Macintosh (Mac OS)
UNIX
Linux
• Specially-built operating systems that are only used
by 1 company or 1 device also exist
Operating system functions
• To overcome the speed mismatch between
computers and humans
• To control hardware (input and output devices)
• To share external resources between users such as
peripherals
• To control/share software, e.g. multitasking,
multiuser
• To allocate internal resources such as
memory/processor time
• To prioritise system requests/interrupts
• To provide an interface between the human and the
computer (HCI = human-computer interface)
Operating system functions
• A computer operates at electronic speeds which a
human cannot match, so it is up to the operating
system to compensate for the speed mismatch
• A computer consists of a large number of
components (hardware/software) which must be
coordinated
• Management of internal/external memory:
– by sharing it between programs and data
– by restricting access
Operating system functions
• Supervision of the running of programs:
– by loading them into internal memory when
required
– by sharing resources between them (allocating
and scheduling)
• To provide a user interface which enables them to
communicate with the system. This could be:
– A command-line interface (eg MS-DOS)
– A menu-driven interface (eg Nokia 3310 phone)
– A GUI/graphical user interface (eg Apple OS X)
Operating system kernels
• The kernel is a central component of the OS
• What does it control? Make a list now.
• It must be loaded into the IAS and kept there during
the running of the computer
• The other parts of the OS do not always have to be
held in the IAS
Memory management
• The operating system allocates blocks of IAS memory
to each program that runs
• A block of memory can be used to hold data or the
program’s instructions
• The data is held in separate locations to instructions
• If 2 or more programs attempt to write to the same
memory location, or they send output to the same
device simultaneously, a clash would occur and
result in the corruption of data
Virtual Memory
• Memory may be insufficient to cope with demand
• Paging is a technique where large, identically-sized
blocks of memory are assigned to every program
• When a page is in use, it is in RAM, but if it is not
needed, it is stored in the hard disk and reloaded
when needed
• Too many swaps between RAM and the hard disk
cause thrashing, which can halt all operations
OS modes of operation
Single-user
Multi-user
Multi-tasking
Multi-programming
OS modes of operation
Single-user
• Designed to be used by 1 user at a time (palmtops).
• The OS is responsible for interacting with one user
and only load one program into memory at any point
in time.
• Eg a gas heating system has an LCD screen and a
keypad to control the timings
OS modes of operation
Multi-tasking
• Numerous user applications can run simultaneously
• An interactive user can control a number of different
tasks/programs “simultaneously” with one
task/program running in the foreground (active
screen) and the others in the background
• The foreground task is given a greater proportion of
processor time and so appears to be running while
the others appear to be inactive
• The user can switch from one application to another
without having to close one and open the other
OS modes of operation
Multi-tasking
• Typical in WIMP (windows icons menus pointers)
systems so that the user can toggle between
windows; each task may have its own window
• The CPU switches from one program/task to another
very rapidly so it appears to be executing all current
programs at the same time, but only one task is
executed at a time
• The OS must keep track of where the user is in these
tasks and enable them to go from one to the other
without losing data (the OS allocates storage and
other resources accordingly)
OS modes of operation
Multi-tasking
• In pre-emptive multi-tasking
• . . . slices of CPU’s time
• . . . are shared between the current programs
• In cooperative multi-tasking
• . . . each program controls the CPU for as long as it
needs
• . . . but can release it for another program
• . . . if it does not need it
• Interrupts are used to change the order when
appropriate
OS modes of operation
Multi-tasking
• Each task can be totally independent of the others
OR
• The tasks may be dependent e.g. they may share
data
OS modes of operation
Multi-programming
• A number of non-interactive programs are executed
“simultaneously”
• The programs occupy main memory simultaneously
• Each program receives a memory space allocation
• Processor time is switched between the programs
• A priority will be allocated to each program
• Used in a batch processing system where different
batch jobs can be executed without user
intervention
OS modes of operation
Multi-user
• Numerous users (a few users up to thousands of
users) can use the system simultaneously
• Resources (processor time/peripherals) are shared
among the users using time slicing
• The users are generally unaware of the other users
• The OS must make sure that the resources allocated
to the current users are balanced so that each user
has sufficient and resources while the overall
performance of the system is satisfactory
• Games consoles with multi-player games are multiuser OS
Multi-user
Transaction Processing
Modes
Batch Processing
Real-time Processing
Transactions
• Transactions are events which need to be recorded, such as
with the production, sale and distribution of goods and
services. Specific examples include:
– Buying an item in a store
– Paying a gas bill
– Taking out a library book
– Applying for a driving licence
– Enrolling on a college course
– Applying for a University place
– Notifying a new employer of your full name, address and
bank account details
– Clocking in and out from work
Master and Transaction files
Master file
• Collection of records holding information about an entity such
as a person or good.
Transaction file
• Holds information about events occurring in the organisation.
• For employee payroll file, basically two kinds of transactions:
– Weekly / fortnightly transaction file with information of
hours worked – used to calculate employees wages or
salary.
– Occasional other transactions to process – additions,
changes and deletions to the file.
• When new employee is hired, new record must be
added
• When employee leaves, their record is deleted
• Employee may change address, bank account, etc.
Batch processing
• Jobs are gathered and stored/held until a suitable
quantity is available OR
• Jobs are stored/held for a specific time period
• All the orders in a batch are processed (usually in a
large volume) at the same time
• … at a convenient time/off peak period
• … in a similar way
• … usually without the need for human supervision
• … and validation by control/batch total is used
• A script/command line language may be used
Batch processing: Stages
• The paper documents are collected into batches of
say 50, checked, control totals and hash totals
calculated and written on a batch header document.
• The data is keyed in off-line and validated by a
computer program.
• It is stored on a transaction file.
• The data is verified by being entered a second time
by a different operator. Any discrepancies are
corrected.
• The transaction file is transferred to the main
computer. This may be physically or electronically
between computers.
Batch processing: Stages
• Processing begins at a scheduled time – maybe
overnight when the network is not busy dealing with
on-line users. All the processing steps (beginning
with the next) can take place without operator
intervention.
• Transaction file may be sorted into same sequence
as master file to speed up the processing of the data
• The master file is updated
• Any required reports are produced
Batch processing: Hash totals
• A hash total is a meaningless total
• All the values of a chosen field (an ID field, a date
field, an ISBN etc.) in a single batch of results will be
added together to give the (meaningless) hash total
• The total gets included into the batch file
• When the batch is processed the batch total will be
recalculated (automatically/by the computer) and
compared with the original
• This can detect (some) errors in batch processing
Batch processing: Control totals
• All the values of an attribute (field) are added
together
• This becomes part of the data and is recalculated
and checked to detect errors after the batch has
gone through processing
• A control total can be useful in its own right – it
could be the total price of a number of orders
• Unlike a hash total, a control total’s value will have a
discernable meaning
Batch processing
• Suitable if data does not need to reflect the real-time
situation
• Typically, large-scale batch system use data collected
on paper documents, or regular bulky weekly or
monthly processes:
– Payroll processing
– Renewal of TV or driver’s licences
– Old banking systems used them for cheques
Batch processing
QUESTION: When money is withdrawn from an
automatic teller machine (ATM), why is batch
processing not suitable?
• If batch processing was used, data about
transactions would be collected over a period of
time and processed some time later
• Once cash has been withdrawn from an account at
the ATM this must be reflected in the state/record of
the account in the bank’s database
• Batch processing would be too slow to enable this to
happen
Real-time Processing
• Transactions are processed directly/immediately
they occur
• ... using an on-line computer system
• Each transaction influences the next transaction
• Each transaction must be completed in full before
the next transaction is processed
• For example, at an ATM, the amount is withdrawn
from the account before any other transaction is
permitted on that account
Real-time processing
• This involves the processing of daily, routine
business transactions such as sales order
processing/reservations
• Each transaction (events such as sales, purchases,
payments received, payments made) is processed
‘straight away’ so that the system is updated fast
enough before the next transaction is processed, in
order to influence the next input
• ATM transactions use real-time processing because a
cash withdrawal must be applied to the balance
before another withdrawal can be made
Real-time processing
•
•
•
•
Transactions will involve changing master files
…eg inserting/modifying/deleting records
…eg bank withdrawls, goods returned, money sent
Transactions are processed as soon as they are
received by the computer system, without delay
• Data files are updated immediately so that the
transaction can influence any further transactions
• The state of the system/data is always up-to-date
• The output can influence the next input (feedback)
Pseudo real-time processing
Real-time processing
• Computer responds instantly and files are updated
immediately
• Example - changes indicated by sensors and probes
in life-support systems or aircraft control systems
Pseudo real-time processing
• Computer records a transaction and more or less
immediately updates the master file (not instantly)
• A delay of a few seconds is quite acceptable for
selling tomatoes in Sainsbury’s or borrowing a library
book, unlike genuine real-time processing
• Example - British Airways Booking System
Choice of processing mode
• Many applications use a combination of batch and interactive
processing. Choosing between modes depends on:
– Does information obtained from the system need to be
up-to-date at all times?
– The scale of the operation - Batch systems well suited to
very high volumes of data, when economical to have an
off-line key-to-disk system for data entry.
– Cost - Real-time system is generally more expensive
because of more complex backup and recovery
procedures required to cope with power failures or
breakdowns.
– Computer usage - Batch system can make use of spare
computer capacity overnight or when computer would
otherwise be idle. Common on mainframe computers.
Past Paper Questions
CCEA AS ICT
1.2.5 System Software
Past Paper: Jan 2009 P2 Q5
(a) Describe the main features of batch processing.
[4]
(b) Describe the main features of real-time processing.
[4]
(c) Identify and justify a common application where batch
processing is suitable.
[2]
(d) Identify and justify a common application where real-time
processing is suitable.
[2]
Past Paper: Jan 2009 P2 Q5
5 (a) Data is gathered/stored as a group
... perhaps off-line
... and processed when convenient
... usually during an off peak period/overnight
All the data undergoes the same processing/similar data
... with minimum/no human involvement
There is usually a large volume of data
(b) There is absolutely no delay in processing/immediate processing
Data is processed fast enough for an input
... to influence the next input
... or transaction
... or the state of the system
The output will influence the next input
(c) Example Payroll
This a regular monthly process [1] + [1] [2]
(d) Example ATM transactions
A cash withdrawal must be applied to the balance before another
withdrawal can be made [1] + [1]
Past Paper: Jan 2011 Q2c
An automated heating system has been installed in a
home. The system uses real time processing.
Explain what is meant by real time processing in this
case.
Past Paper: Jan 2011 Q2c
• The processing of data about the heating system as it
is received/generated
• . . . and producing results without delay/immediate
feedback
• . . . so the result is reflected/effective for the next
processing activity
• Example – the system always has up-to-date data
about temperatures in the home
Past Paper: Jun 2011 Q3d
A lecturer uses a multi-tasking operating system.
Identify four main features of a multi-tasking
operating system.
Past Paper: Jun 2011 Q3d
• Enables the user to perform more than one
task/program at a time
• Each task may have its own window
• Each task can be totally independent of the others
• The tasks may be dependent e.g. they may share
data
• The OS allocates storage and other resources
accordingly
• In pre emptive multitasking, the OS allocates CPU
time slices to each program/task
• In cooperative multitasking, each program has use of
the CPU for as long as it needs