Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 9

Annexure

Homework type/no: 1 Course code: CAP 581

Course instructor: Ms. KULJEET KAUR

Date of allotment: 12/01/2011 Date of submission:


22/01/2011

Student roll no: RA3801A19 Section no: A3801

Declaration:

I declare that this assignment is my individual work. I have not copied from any
other student’s work or from any other source except where due acknowledgment
is made explicitly in the text, nor has been written for me another person.

Student’s signature:
ANKUR RAJ PANDEY.

Evaluator’s comments:

Marks obtained _____________________ out of


______________________________

Content of home work should start from this page only:

Part-A
Q. 1 Identify at least 5 real time application areas.

Ans. In computer science, real-time computing (RTC), or reactive computing, is the study of
hardware and software systems that are subject to a "real-time constraint"—i.e., operational
deadlines from event to system response. Real-time programs must execute within strict
constraints on response time. By contrast, a non-real-time system is one for which there is no
deadline, even if fast response or high performance is desired or preferred. The needs of real-
time software are often addressed in the context of real-time operating systems, and synchronous
programming languages, which provide frameworks on which to build real-time application
software.

real time application:-

1.Testing an Air Traffic Control application displaying environmental data

2. The CommuniGate Pro Real-Time Application module provides an infrastructure to design


and deploy applications processing various Signals.
Real-Time Applications used to process voice calls include voice mail, auto-attendant,
conferencing, etc. These applications implement the "IP-PBX" functionality, providing an
Internet standards-based alternative to legacy PBX (Private Branch Exchange) systems.

3. The WebAdmin Interface provides the Real-Time Application Environment Editor pages to
manage Server-wide, Cluster-wide, and Domain Application Environments.

The Environment Editor page contains the list of all files "visible" in this Environment: it lists
files directly uploaded to this particular Environment, as well as all files uploaded to the
Environments used as the "default files" source for this Environment.

4. The Bridged Call functionality is used to implement the B2BUA (Back-to-Back User Agents)
technology. A pair of Real-Time Tasks in the Bridged Mode can work as a "smart proxy": while
peers connected to these tasks can communicate directly, the signaling is still controlled with the
Tasks and the application programs these Tasks are running.

5.Artificial intelligence

Q. 2. Differentiate between hard and soft real time systems.


ANS. A system is said to be real-time if the total correctness of an operation depends not only
upon its logical correctness, but also upon the time in which it is performed.
Hard real time systems:-

The classical conception is that in a hard real-time or immediate real-time system, the
completion of an operation after its deadline is considered useless - ultimately, this may cause a
critical failure of the complete system.

thus, the goal of a hard real-time system is to ensure that all deadlines are met,

Hard real-time systems are used when it is imperative that an event is reacted to within a strict
deadline. Such strong guarantees are required of systems for which not reacting in a certain
interval of time would cause great loss in some manner, especially damaging the surroundings
physically or threatening human lives

Hard real-time systems are typically found interacting at a low level with physical hardware, in
embedded systems.

soft real time system:-

A soft real-time system on the other hand will tolerate such lateness, and may respond with
decreased service quality (e.g., omitting frames while displaying a video).

but for soft real-time systems the goal becomes meeting a certain subset of deadlines in order to
optimize some application specific criteria.

Soft real-time systems are typically used where there is some issue of concurrent access and the
need to keep a number of connected systems up to date with changing situations; for example
software that maintains and updates the flight plans for commercial airliners. The flight plans
must be kept reasonably current but can operate to a latency of seconds. Live audio-video
systems are also usually soft real-time; violation of constraints results in degraded quality, but
the system can continue to operate

Q. 3 Elaborate the three model elements for a real time system that helps designing
a reference model.

Ans. Components of a model:


1) Workload Model - Applications supported by system. It has following the following
parameters:
• Temporal Parameters
• Functional Parameters
• Resource Parameters
• Interconnection Parameters

2) Resource Model - System resources available to applications

3) Scheduling Model - How application system uses Resources

Workload Model –
A job is a unit of work that is scheduled and executed by a system
– e.g. computation of a control-law, computation of an FFT on sensor data,transmission of a data
packet, retrieval of a file
• A task is a set of related jobs which jointly provide some function
– e.g. the set of jobs that constitute the “maintain constant altitude” task, keeping an airplane
flying at a constant altitude

INTERCONNECTION PARAMETERS
• Defines how the job depends on others, how others depend on it.
• Some types of edge-interconnection parameters:
 Data dependency
 Temporal Dependency

• Temporal dependency is an important parameter in applications like LipSync

2) RESOURCE MODEL

 Modeling of resources as
• Active resources (Servers/Processors)
• Passive resources (Resources)
 Processors: CPU, Transmission Link, Disks, etc.
 Processors carry out machine instruction, move data, retrieve files, etc.
 Resources: Memory, mutexes, locks, etc.
 Some Characteristics:
• Context Switch Time
• Pre-emptivity
 Parameters of Resource Vs Resource Parameters of Job

3)SCHEDULING MODEL

 Jobs scheduled and allocated resources according to a chosen set of scheduling


algorithms and resource access-control protocols
• Scheduler implements these algorithms
 A scheduler specifically assigns jobs to processors.
 A schedule is an assignment of all jobs in the system on the available processors.
 A valid schedule satisfies the following conditions:
• Every processor is assigned to at most one job at any time
• No job is scheduled before its release time

• The total amount of processor time assigned to every job is equal to its
maximum or actual execution time.

• All the precedence and resource usage constraints are satisfied

Part-B

Q. 4 Consider a real time system. Identify the psuedocode and draw the task graph
for the same.

Ans. BANKING

Pseudocode for the init page

GET /bank/init.php?BESIM_HOST=besimhost1+besimhost2&BESIM_PORT=81+82\
&BESIM_URI=/BeSim/specweb2009_besim&BESIM_PERSISTENT=true\
&PADDING_DIR=/data/SPECweb2009/bank/dynamic_padding/\
&SMARTY_DIR=/data/SPECweb2009/assl/Smarty2.6.2/libs/\
&SMARTY_SUPPORT_DIR=/data/SPECweb2009/support/\
&SEND_CONTENT_LENGTH=true
[Foreach name, value pair in QUERYSTRING]

Set name = value (NOTE: these must persist across script executions)

[End Foreach]

Set BESIM_COUNT = [# BESIM_HOST/BESIM_PORT pairs]

Set SERVER_TIME = [# milliseconds since the Unix Epoch]

Return Page with HTML =

<html>

<head>

<title>SPECweb2009 Ecommerce Workload Init</title>

</head>

<body>

<P>SERVER_SOFTWARE = [Substitute web server variable: "SERVER_SOFTWARE"]</P>

<P>REMOTE_ADDR = [Substitute web server variable: "REMOTE_ADDR"]</P>

<P>SCRIPT_NAME = [Substitute web server variable: "SCRIPT_NAME"]</P>

<P>QUERY_STRING = [Substitute web server variable: "QUERY_STRING"]</P>

<P>SERVER_TIME = [SERVER_TIME]</P>

</body>

</html>

Pseudocode for login page

Sample requests:
GET /bank/login.php HTTP/1.1
or
POST /bank/login.php HTTP/1.1
[rest of HTTP headers]
Content-Type: application/x-www-form-urlencoded
Content-Length: 19

userid=6&password=6
Set MESSAGE = ''
[If {POST_DATA['userid']} and {POST_DATA['password']} are not set]
[No-op]
[Else If {POST_DATA['userid']} or {POST_DATA['password']} are empty]
Set MESSAGE = 'No empty user id or password allowed!'
[Else]
Set REAL_PASSWORD, ERROR_NUM = [BESIM query with REQUEST = '1&' +
{POST_DATA['userid']}]
[If ERROR_NUM not 0]
REAL_PASSWORD = ''
[End If]
Set FORM_PASSWORD = [MD5 hash of {POST_DATA['password']}]
[If REAL_PASSWORD equivalent to FORM_PASSWORD]
Set ACCOUNT_BALANCE_ARRAY, ERROR_NUM = [BESIM query with REQUEST
= '2&' + {POST_DATA['userid']}]
Return Page with HTML =
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>SPECweb2009: Welcome</title>
</head>
<body bgcolor="white">
<!-- SPECweb2009 Dynamic Data Area -->
<table summary="SPECweb2009_User_Id">
<tr><th>User ID</th></tr>
<tr><td>{POST_DATA['userid']}</td></tr>
</table>
<table summary="SPECweb2009_Acct_Balance" cellpadding=3 border=1>
<tr>
<th>Account</th>
<th>Type</th>
<th>Balance</th>
</tr>
[Foreach account in ACCOUNT_BALANCE_ARRAY]
<tr><td>{account[accountno]}</td>
<td>[If {account[type]} == "1"]
Checking
[Else If {account[type]} == "2"]
Saving
[Else]
Other
[End If]</td>
<td>{account[balance]}</td>
</tr>
[End Foreach]
</table>
<!-- SPECweb2009 Displayable Page Title -->
<table>
<tr>
<td><b><font color="#9400d3">SPECweb2009: Welcome User</font></b></td>
</tr>
</table>
<!-- SPECweb2009 User Action Area -->
[Include Menu Template]
<!-- SPECweb2009 Image References -->
<!-- SPECweb2009 Embedded Text -->
<pre>
[Include [PADDING_DIRECTORY]/welcome]</pre>
</body>
</html>
Set {SESSION_ARRAY['userid']} = {POST_DATA['userid']}
[EXIT]
[Else]
Set MESSAGE = 'Incorrect user id or password!'
[End If]
[End If]
Return Login Page Template

Q. 5 Comment on the significance of functional parameters in real time systems.


Ans.

• Preemptivity
– Preemption: suspend job then dispatch different job to processor. Cost includes context
switch overhead.
– Non-preemptable task - must be run from start to completion.
• Criticalness - positive integer indicating the relative
importance of a job. Useful during overload.
• Optional Executions - jobs or portions of jobs may be declared optional. Useful during
overload.
• Laxity - Laxity type => hard or soft timing constraints.Supplemented by a usefulness function.
Useful during overload.

Response to missing a deadline can vary


– Some jobs have optional parts, that can be omitted to save time (at the expense of a poorer
quality result)
– Usefulness of late results varies; some applications tolerate some delay,others do not

Q. 6. Explain the role played by constraints and dependencies.


Ans. This real time system helps the control of the traffic or we can say control the vehicles
traffic over the roads.
It also includes constraints such as time constraints, memory constraints etc.

This system depends upon the time constraints relatively.

Role played by constraints and dependencies in real time systems with the example of traffic
intersection control system that controls the traffic system:-

This system includes constraints such as:


1. Regularity policy
2. Dot specifications
3. Local ordinances
4. Hardware
5. Minimum time

This system includes dependencies such as:

• SI units are used for all physical quantities.


• Commercially available RTOS is used.

You might also like