Skip to main content

Posts

Database for Hard Real time Systems

Databases for real time systems are meant for the use of both hard and soft systems. Since hard real time systems needs strict timing constraints, conventional disk based databases are not suitable, but soft real time systems makes use of disk based systems through FCFS, Elevator or scan policy algorithm. There should be some solution for Hard Real time systems with high performance and guaranteed response time constraints. MDARTS (Multiprocessor Database Architecture for Real Time System) is one such main memory database which uses VME based processors. Features This is for Hard Real time Systems It is a main memory database (the entire database resides on the main memory) Object oriented database (C++ elements) Supports explicit declaration of real time constraints and semantic constraints within the application code. Constraints Specifications Access time ”write The above are the constraints which can be included in the application code directly without the recompilation of the MDAR...

Databases for Soft Real Time System

In disk based scheduling, the disks are located and traced by traversing the sectors and tracks. Tracks are concentric circles and sectors are just originating from the center of the disks. So, disk scheduling algorithms are slower when compared with the memory based scheduling. Under disk based scheduling Ta=Tw+Tp+Tt Ta is the access time Tw is the time spent in queue Tp is the time to position the arm to locate the sectors and track Tt is the time taken to transfer the block of data. Since Tp is in the order of few milliseconds, but CPU time is hardly around 50nano seconds, so disk based scheduling algorithms are not suitable for hard real time systems. However these algorithms, can be made useful for soft real time systems. Disk based scheduling will be useful for Soft Real time system based on the following algorithms First Come First Serve (FCFS) The task or transaction which comes first will be scheduled and then the next, here the main problem is if the requests are huge then t...

Concurrency Control Issues

Pessimistic Concurrency Control The transactions are been checking for violating the serialization consistency before letting it execute is called pessimistic concurrency control Two phase locking Scheme Read /Write lock as a phase Unlock – another phase Both the above phases wont interleave, because of this, there may be deadlock, which can be detected by means of deadlock detection algorithm and if deadlock is there, one of the transactions is aborted with the nearer timestamp. Multiversion Scheme There are three locks Read, Write and Certify Read lock – Read the needed data from the database Write lock – Writing to its own private space Certify lock – Updates to the database, this stage is the committed stage. General locking Rules Lock Already Set Lock Requested Read Write Certify Read Granted Granted Blocked Write Granted Granted Granted Certify Blocked Granted Blocked   Locking rules for priority Inversion Lock Already Set by a Low Priority Transaction Lock Requested by a High Pr...

Transaction Abortions

Transaction Abortions Transaction abortion is of two types, either Termination abortion or The Transaction which is aborted in this way won't be restarted Example: An attempt to divide by zero error Non Termination Abortion The transaction which will be restarted after it is being aborted Example: data conflict due to a deadlock, If two transactions are involved in a deadlock, one of the transaction will be aborted and will be restarted

Transaction Priorities

Transaction Priorities Transactions are granted access to the processors based on their priorities. All the transactions in the real time DB are associated with a deadline, hence Earliest Deadline First (EDF) algorithm finds a greater solution to schedule those transactions. But EDF algorithm will be working efficiently if the number of transactions are moderate. But usually the DB transactions are huge in a systems and EDF may not be suitable which leads to congestion. To avoid the above solution an algorithm Adaptive Earliest Deadline (AED) algorithm which uses congestion control and also can process huge number of transactions. It uses two groups HIT and MISS group. All the transactions in the HIT group will be meeting their deadlines, if by chance any transaction does not meets its deadline, then that transaction will be aborted. Operation of AED When a transaction arrives, the system randomly inserts it in a list of pending transactions, if the assigned transaction is in the list ...

Main Memory Databases

Main Memory Databases The entire database is residing on the main memory is the concept behind main memory databases. But there are some problems like data backups and storing logs. So Main memory databases are to rely on Disk based systems to store logs and backups. General purpose databases are really huge to sit in to the main memory and they just rely on disk based systems, but real time databases are small and even if it is moderate size, it still sits on the main memory because of speed and cheaper solution. Main memory can be used to write log once a transaction commits . The entire log is huge to sit in the main memory, so it is necessary to store logs in the disks at batch mode or by transaction by transactions. In the former case (batch mode), the buffer store upto a volume of logs, then at a stretch it will store in the disks. Pointers are used to access record or data in main memory Databases because of cheaper solutions and speed. If there are multiple copies of the...

Installing NS2 under Ubuntu 8.04.1, 8.10, 9.04

Download NS2 from the following Website, I tried version ns-allinone-2.33.tar.gz . Put the file under /home/pradeep/ (my user login is pradeep, you may try with your username) go the folder in the shell prompt by issuing the following command cd /home/pradeep/ Since installation of NS2 simulator needs some autoconfiguration files which will need to be installed. To download those packages, just execute the following commands $ sudo apt-get install build-essential autoconf automake libxmu-dev it will take some time to download and install. Now execute the following steps so that NS2 will be installed $ tar zxvf ns-allinone-2.33.tar.gz $ cd ns-allinone-2.33 $ ./install After the above three steps, NS2 will gi...