Wednesday, March 13, 2013

Operating Systems: Processes



         In computer science, operating systems are modelled to support multiprocessing to increase efficiency. Scheduling, concurrency and resource allocation are core factors of Operating system efficiency. This article examines operating system problems that emerge as result of these factors. It is acknowledged that this complexity involves programming but this article will not dive into programming details.
The Producer Consumer Problem
            This problem is associated with the multi-process synchronization. It demonstrates the need to synchronize systems when several processes share a resource. In the problem, two processes share a single fixed size buffer (Single resource). One process generates some data/information and puts it in the fixed buffer, and starts again (Producer). Simultaneously, the remaining process utilises or consumes the data/information by removing it from the fixed buffer one piece at a time (Consumer). The problem is that these process do not take turns accessing the buffer, instead, they work concurrently. In that, if the producer tries to put piece of data into the buffer and the buffer is full, a problem will occur. On the contrary, if the consumer tries to take an item from an empty buffer, a problem will occur. Grand puts it plainly, The problem is to make sure that the producer won't try to add data into the buffer if it's full and that the consumer won't try to remove data from an empty buffer (Grand, 2002). In order synchronization to happen, using programming logic we should block the producer when the buffer is full and block the consumer when the buffer is empty. However, you must reactivate them as soon as the status changes from full to not full / empty to not empty so that they continue with their work otherwise a deadlock will emerge. Adam Donlin explains that, “In short, the Producer relies on the Consumer to make space in the data-area so that it may insert more information whilst at the same time, the Consumer relies on the Producer to insert information into the data area so that it may remove that information. It therefore follows that a mechanism is required to allow the Producer and Consumer to communicate so that they know when it is safe to attempt to write or read information from the data-area”.
Solutions
         The solution for the producer is to either go to sleep or discard data if the buffer is full. The next time the consumer removes an item from the buffer, it notifies the producer, who starts to fill the buffer again. In the same way, the consumer can go to sleep if it finds the buffer to be empty. The next time the producer puts data into the buffer, it wakes up the sleeping consumer. The solution can be reached by means of inter-process communication, typically using semaphores. An inadequate solution could result in a deadlock where both processes are waiting to be awakened. The problem can also be generalized to have multiple producers and consumers (Wikipedia, 2013). This problem can be handled using semaphores, monitors and message passing. Further details check links below.
References
Mark Grand Patterns in Java, Volume 1, A Catalog of Reusable Design Patterns Illustrated with UML

Monday, March 11, 2013

DATABASE MANAGEMENT SYSTEMS

Introduction

         Data is a collection of raw facts and figures which, when processed translates into facts or information. The nature of data demands storage and retrieval when needed. Thus, storing data becomes necessary based on that reasoning. Data can be stored in files or databases. However, what is a database? How different is it from a file based system? This article approaches databases from an academic point of view.

Old is Gold (File-based System)

         “The best way to know where you are and going”, says an old proverbial, “is to know where you have come from”. Data storage started with flat file system. It was the first attempt to computerize the manual paper files and cabinet system. Connolly and Begg (2008), elaborate about file based system as a system where each program defines and manages its own data. Flat files were independent and incompatible, each having its own file extension, attributes and behaviour. Apparently, this succumbed to following limitation.

1.Isolation of data makes it difficult to access related data for both user and application

2.It duplicates data wasting space and resource

3.File structure is hardcoded and alterations are difficult to make (program-data dependence).

4.File formats are incompatible

5.No standardised queries for mining the data.

Old is Gone (Database systems)

         The world is thirsty of efficient system; this is where the file based system lost its battle as the best data storage. Database took over, as to when was that, hahaha! Join a history class. That was not funny, but, we are addressing databases not history of databases. Then, what is a database? It is a shared collection of logically related data, and a description of data, designed to meet an organization’s information needs (Connolly and Begg, 2008, pp. 15). Amazingly, databases have two structures: internal and external. The internal definition is separate from the external. This allows us to change the internal definitions without interfering with the user objects, provided the external definitions remain the same- a process called data abstraction. Databases are made of entities (Distinct objects like people), attributes (property that describes and object) and relationship (an association between entities), and managed by database management system.

 Database Management System (DBMS)
DBMS and database

         This is a program that provides interaction between the user or application software and the database. It presents the ability to define, create, maintain and control access to database through:

1.Data Definition Language (DDL)– defines data types, constraints, and structure of database.

2.Data Manipulation Language (DML) – generally inserting, updating and deleting records of database

3.Security – ensure authorises access of data.

4.Integrity – maintaining data consistency

5.Concurrency – Allowing multiple accesses to data (share).

6.Recovery – restoring data in-case of failure

Advantages of DBMS

·   Eliminates data redundancy problem

·   Provides data consistency – any update has to be performed only once and could apply to multiple

·   Offers sharing of data (multiple access support)

·   Improves data integrity –ensuring data entered is valid and meets all set constraints.

·   Improved security – protection of data from unauthorised users

·   Allows DBA to enforce necessary defined standards like naming conventions and access rules

·   Offers economies of scales – many applications can access single database hence saving cost

·   Improved data access and response through use of standard language SQL

·   Improved back-ups and recovery services

Disadvantages

·   DBMS are extremely complex and need expertise to handle

·   They can grow into large volumes (size/bulkiness) consuming a lot of space in a system

·   DBMS software is very expensive to purchase

·   They come with an overhead that is may require additional storage hardware

·   Because of its centralised approach it presents a single point of failure in case of any problem
 References

CONNOLLY, T. M., & BEGG, C. E. (2008). Database solutions: a practical approach to design, implementation and management. Harlow, England, Pearson/Addison Wesley.

Wednesday, September 5, 2012


SPSS Measurable Level
Statistical variables can be measured as nominal, ordinal or scale. Variable is measured
  1. Nominal: when its values represent categories that does not belong to a ranking like zip code, department ID religion.
  2. Ordinal: when its values represent categories that belong to a ranking like degree of satisfaction (dissatisfied to highly satisfied) or attitude scores.
  3. Scale: when its values represent ordered categories or meaningful metric like age or income

Monday, January 30, 2012

Computer Memory (RAM)


“Are you a technician?”, “Yes”. “Yes! You said yes, then more memory please my computer is slow, put more memory.”…
Computer memory is a physical device (hardware) that stores data and programs (instructions) on temporary or permanent basis and can be read or written or erased or both. Random Access Memory (RAM) commonly referred main / primary memory is a temporary storage device which stores data and instructions that the CPU requires currently as it process. It is also termed volatile because it requires constant supply of power to retain data (memory).
Memory upgrade has great impact on computer performance up to a point. It’s technically advised to take note that:
  • motherboards have memory limits
  • Operating systems have memory limits
  •  CPUs have memory limits.
 So it’s not a ‘…more memory please…’ thing. The listing below is a quick academic summary on RAM, if you note flaws post it for a revision, enjoy.
Types of Memory (RAM)
Dynamic RAM (DRAM)
Special type of memory that uses microscopic capacitors and transistors to store zeros and ones. A single chip can hold millions of these capacitors and transistors in combination thus holding millions of bits. It’s dynamic since the chip needs constant update signal (refresh cycle) in order to retain information, otherwise it will fade off. DRAM is categorized as Asynchronous or Synchronous.
Asynchronous DRAM
Asynchronous because it doesn’t depend on the CPUs external clock, this leads to some increased access time while processor experiences wait times (delay). During wait times the CPU does nothing. They include:
Fast Page Mode (FPM DRAM) - a lower performance and slow memory with better access time than conventional DRAM but maxes out 50 MHz processor speed (outdated)
Click the memory type chart to enlarge
Extended Data Out DRAM (EDO DRAM) – like FPM maxes 50 MHz of processor but slightly faster, has some cache built into its chip. (outdated) 

Synchronous DRAM (SDRAM)
The DRAM whose speed is directly dependant (tied to) on clock speed of system, it’s synchronized with the system bus. Scales speeds above 133 MHz. Designed to write and read from the memory 1 clock cycle per access with a zero wait state (delay). SDRAM is 3.3v and 168 pin module fitting into a DIMM slot.
Double Data Rate SDRAM (DDR SDRAM)
Transfers data twice per clock cycle at the rising and falling edge of the clock, hence double rate (double of conventional SDRAM). Operates at 266 MHz speed, 2.5v with 184 pin DIMM module, is not compatible with SDRAM.
DDR2
Unlike DDR it was designed to provide great bandwidth with reduced power consumption, 333 MHz speed, 1.8v and 240 pin module.
DDR3
A better generation of DDR with Memory with speed of 1000 MHz. Data Transfers/Sec.: 2,000,000,000. Module Name: PC3-16000. Has better voltage consumption.
Direct Rambus DRAM (DRDRAM)
Designed by Rambus Company, uses burst mastering with speeds of 800 MHz and higher, used on a dual channel 32 bit motherboard. Because of the speed it generates a lot of heat, uses RIMM modules.
Synchronous Link DRAM (SLDRAM)
Competitor of DRDRAM speeds up to 400 MHz
Static RAM (SRAM)
Unlike DRAM this is a fast and expensive memory.  It uses electrical pulse to flip its logic state from 1 to 0 or flop from 0 to 1; this state will stay its position till another pulse is received thus static. Because of that it doesn’t require refresh cycle. It includes:
Async SRAM – used for L2 cache and was independent of the system clock, introducing wait states
Synch SRAM – synchronized with the system clock, has good speed but expensive.
Pipeline Burst SRAM – sends larger packets of data to the memory at once, operates at bus speeds above 66 MHz.
Written by Michael Akunga
Courtesy of pcguide.com, pctechguide.com, hexus.net and computermemoryupgrade.net

Monday, January 16, 2012

Computer History Chronology

 Someone told me, " you want to be a geek, learn the past first" and I taught that was stupid, I learnt the truth, the past is a key to many things.  This looks crap, but drill it down then you see something, well this information is not complete, critics will say! please post you chronology and I will update the same.
Year Events
1971 The 4004—the first 4-bit microprocessor—is introduced by Intel. It boasts 2000 transistors with a clock speed of up to 1 megahertz (MHz).
1972 The first 8-bit microprocessor—the 8008—is released.
1974 The 8080 microprocessor is developed. This improved version of the 8008 becomes the standard from which future processors will be designed.
1975 Digital Research introduces CP/M—an operating system for the 8080. The combination of software and hardware becomes the basis for the standard computer.
1976 Zilog introduces the Z80—a low-cost microprocessor (equivalent to the 8080).
The Apple I comes into existence, although it is not yet in widespread use.
1977 The Apple II and the Commodore PET computers, both of which use a 6502 processor, are introduced. These two products become the basis for the home computer. Apple's popularity begins to grow.
1978 Intel introduces a 16-bit processor, the 8086, and a companion math coprocessor, the 8087.
Intel also introduces the 8088. It is similar to the 8086, but it transmits 8 bits at a time.
1980 Motorola introduces the 68000—a 16-bit processor important to the development of Apple and Atari computers. Motorola's 68000 becomes the processor of choice for Apple.
1981 The IBM personal computer (PC) is born; it contains a 4.7-MHz 8088 processor and 64 kilobytes (KB) of RAM (random access memory), and is equipped with a version of MS-DOS 1.0 (three files and some utilities).
Available mass-storage devices include a 5.25-inch floppy drive and a cassette tape drive.
1982 Intel completes development of the 80286—a 16-bit processor with 150,000 transistors.
MS-DOS 1.1 now supports double-sided floppy disks that hold 360 KB of data.
1983 IBM introduces the XT computer with a 10-MB hard disk drive.
MS-DOS 2.0 arrives; it features a tree-like structure and native support for hard disk drive operations.
1984 The first computer with an 80286 chip—the IBM AT—enters the market.
It is a 6-MHz machine with a 20-MB hard disk drive and a high-density, 1.2-MB 5.25-inch floppy disk drive.
Apple introduces the Macintosh computer, marking the first widespread use of the graphical user interface and mouse.
1985 MS-DOS 3.2, which supports networks, is released.
1986 The first Intel 80386-based computer is introduced by Compaq; it features a 32-bit processor with expanded multitasking capability (even though no PC operating system yet fully supports the feature).
1987 MS-DOS 3.3 arrives, allowing use of 1.44-MB 3.5-inch floppy disk drives and hard disk drives larger than 32 MB.
1988 IBM introduces the PS/2 computer series. A complete departure from previous machines, its proprietary design does not support the hardware and software available on IBM PCs or clones.
Microsoft (with the help of IBM) develops OS/2 (Operating System 2), which allows 32-bit operations, genuine multitasking, and full MS-DOS compatibility.
Microsoft releases MS-DOS 4.0.
1989 Intel introduces the 80486 processor; it contains an on-board math coprocessor and an internal cache controller (offering 2.5 times the performance of a 386 processor with a supporting coprocessor).
1991 MS-DOS 5.0 offers a significantly improved DOS shell.
1992 The Intel i586 processor, the first Pentium, is introduced, offering 2.5 times the performance of a 486.
Microsoft introduces Windows 3.1, vastly expanding the use of a graphical user interface in the mass market. IBM expands OS/2.
1993 MS-DOS 6.0 arrives. The term "multimedia" (the inclusion of CD-ROM drives, sound cards, speakers, and so forth, as standard equipment on new personal computers) comes into use.
1994 Intel delivers the first 100-MHz processor. Compaq Computer Corporation becomes the largest producer of computers.
1995 Windows 95, code-named Chicago, is introduced by Microsoft. It features 32-bit architecture.
The Internet, having expanded far beyond its beginnings as a network serving government and university institutions, is now in everyday use by the rapidly growing proportion of the population with access to a modem.
Computer prices drop as performance increases. IBM purchases Lotus (maker of the popular Lotus1-2-3 spreadsheet).
1995-1996 Software manufacturers scramble to make their products compatible with Windows 95.
1997 Microprocessor speeds exceed the 200-MHz mark. Hard disk drive and memory prices fall as basic system configuration sizes continue to increase.
CD-ROM drives and Internet connections have become standard equipment for computers.
1998 PC performance continues to soar and prices continue to fall. Central processing unit (CPU) speeds exceed 450 MHz, and motherboard bus speeds reach 100 MHz
Entry-level machines are priced near the $500 mark.
Universal serial bus (USB) is introduced.
Windows 98 becomes the standard operating system for most new personal computers. Computer prices drop well under $1,000, increasing computer sales to the home market.
1999 Processor speeds exceed 1 gigahertz (GHz). E-commerce grows dramatically as the Internet expands.
2000 Microsoft releases Windows 2000 and the basic PC becomes a commodity item in discount stores. Broadband connections such as DSL and cable begin to take hold, making Internet access easier and faster than over the telephone line.

Wednesday, October 5, 2011

Important Networking Devices


Computer network devices (are routers, switches, hubs, LAN cards, gateway, modems, hardware firewall, CSU/DSU, ISDN terminals and transceivers)  In an Ethernet or WAN network, the data communication cannot be performed without these devices. 
Major vendors / Manufacture are Cisco, D-Link, LinkSys, Baynet, RealTek, 3Com, NetGear, Intel, Nortel, and Lucent  
Routers
Is a communication device that is used to connect two logically and physically different networks like two LANs, two WANs and a LAN with WAN. 
The main function of the router is to sorting and the distribution of the data packets to their destinations based on their IP addresses. Provides the connectivity between the enterprise businesses, ISPs and in the internet infrastructure, as main device. 
 Every router has routing software, which is known as IOS. 
Router operates at the network layer of the OSI model.  Router does not broadcast the data packets.
Switches
Like the router, a switch is an intelligent device that maps the IP address with the MAC address of the LAN card.  Unlike the hubs, a switch does not broadcast the data to all the computers, it sends the data packets only to the destined computer.  Switches are used in the LAN, MAN and WAN.  In an Ethernet network, computers are directly connected with the switch via twisted pair cables.  In a network, switches use the three methods to transmit the data i.e. store and forward, cut through and fragment free.
Hubs
The central connecting device in a computer network is known as a hub.  There are two types of a hub i.e. active hub and passive hub.  Every computer is directly connected with the hub.  When data packets arrives at hub, it broadcast them to all the LAN cards in a network and the destined recipient picks them and all other computers discard the data packets.  Hub has five, eight, sixteen and more ports and one port is known as uplink port, which is used to connect with the next hub.
Modems
A modem is a communication device that is used to provide the connectivity with the internet.  Modem works in two ways i.e. modulation and demodulation. It converts the digital data into the analog and analog to digital

LAN Cards
LAN cards or network adapters are the building blocks of a computer network. No computer can communicate without a properly installed and configured LAN card. Every LAN card is provided with a unique IP address, subnet mask, gateway and DNS (if applicable).  An UTP/STP cable connects a computer with the hub or switch.  Both ends of the cable have the RJ-45 connectors one is inserted into the LAN card and one in the hub/switch.  LAN cards are inserted into the expansion slots inside the computer.  Different LAN cards support different speed from 10/100 to 10/1000.
Multiplexer
Multiplexer is a device that is used to combining the several electrical signals into one signal
Bridge
A bridge is a network communication device that is used to connect one segment of the network with another that uses the same protocol.  It operates at the Data link layer of the OSI layers model.  In the Ethernet network, the bridge is also known as IEEE 802.1D.  A bridge process the information at the data link layer of the OSI layers model.  There are two types of the bridging.
  • Transparent bridging
  • Source route bridging
Bridges are fast devices for forwarding the data but not as fast as the routers and switches.  A bridge cannot be used as a firewall device as a router.  In the bridged network, the messages are sent to all the nodes and are picked up only by the destined computers. 
Broadband Router
A router is a network communication device that is used to connect two different networks and to provide the internet connectivity to the users. A broadband router is essential part of the home or office network where the high speed internet connectivity is required. 
Using a broadband router, the network computers can share the internet and send and receive the data with every other user on the network.  It shares the internet connection by using the NAT (Network Address Translation). There are the following three purposes of the broadband routers.
  • To provide the high speed internet connectivity to the network users.
  • To route the traffic between the network computers.
  • To filter the traffic through the built-in firewall features.
It distributes the IP addresses dynamically thus it functions as a DHCP server.