As the first of the project, the Author opt to write a brief overview of airport parking system and its own processes to be able to enlighten and understand clearer the actual project is all about. Some of the features of the current airport parking systems will be recorded here, together with the major and basic types of airport parking system. The writer desires to find and file some basic advantages, cons, and symbols used in car parking area.
The chapter is also going to explore the product of the study conducted on existing airport parking systems. The opportunity of this chapter is basically to recognize some airport parking system and compare them, to create some limitations of the current system. The author will propose some solutions to implement from the problems being identified. All the above studies will be hopefully documented at the end of this chapter.
Definition
Car parking system is a system that is employed to help taking care of cars in parking area in other to avoid congestion and arrange vehicles within an allocated position. The system also helps to track just how many cars pass through the gate and the period considered by each, and then it'll calculate the money an automobile should pay when exiting. Car parking system is being found in many congested area or location where there are many meeting point of individuals like where there are more than one shopping complex close to the other person or where there is megamall or stadium. For example like Sunway pyramid, Lowyat and Timesqure, and Midvaley megamall all in Malaysia.
Types of car Parking System
Based on the authors' research, there are mainly four types of car park assistance systems using different technologies - wired sensor-based, cellular sensor-based and image-based, counter-based.
:
Wired Sensor-Based
Wired sensor-based system is using recognition detectors such as ultrasonic sensors that are installed at each auto parking lot. These sensors are wired to a central control unit that store and take care of the parking occupancy information. This information is then ahead to display sections at intentional locations in the automobile park. The screen panels provide information, path and guide the motorists to vacant parking lots.
Wireless Based
With the improvement of wireless solutions, wireless structured methods have been used in parking assistance systems. Wireless sensors nodes are deployed and each parking lot has one node. The sensor mother board has the sensors of light, temperatures, acoustic and a sounder. In using cordless technologies, disadvantage in employing sensor at each auto parking lot is still present and can be very costly as each sensing unit is usually fastened with a processing product and a transceiver.
Image based
Image established techniques or some people call it as video sensor techniques. A couple of arguments regarding the viability of using image-based techniques. The cons are video sensor is energetically expensive and video sensor can make massive amount data which can be difficult to transmit in a radio network.
Counter-based
The last group of car park assistance systems use is Counter-based systems designed to use sensors to count the number of vehicles getting into and exit a car park area. This is gate-arm counters and induction loop detectors located at the entrances and exits. This system can give information on the total amount of vacant a lot in a sealed car park area, but does not help much in guiding the drivers to the precise located area of the vacant lots.
General top features of Car Parking System
Enable the drivers to collect solution upon entry: car Parking system can allow the drivers to get his solution after he press the button of the gate barrier.
The system should record the entire vehicles that go through the access.
The system should allow the gate to open up whenever a driver has press the button and take his solution.
Allow the motorists to make payment: if it's of commercial use, the machine should enable the drivers to make repayment of these charges before exiting.
Allow the driver to leave: if the drivers has paid his charges and require exiting, the machine should open the gate to allow him exiting.
Process of Airport parking System
From the study conducted, the author can state that, there is not much direct interaction between the system and an individual. Though some car parking systems have different types of procedures, but for a parking system like in Sunway pyramid, the author got to understand that the process is generally the following.
The customer presses the button on the machine; ticket should come away from it and the customer take his solution and then the gate will start. The client will now check out the available space. The available spots are known by the green light bulb on top of each available great deal. The red light on top of parking lot point out either the space has been reserved or there is car parked at it.
For the process of exiting, if the customer is using "touch and go" (Malaysian prepaid card), there is a sensor provided that may read the credit card and if there is enough money the system will deduct the quantity of the charges.
But if the customer will pay cash there can be found paying machines which the customer will add his ticket and the system will browse the ticket, estimate the hours put in and calculate the amount to be paid by the customer. Customer should put the money stated by the machine into machine. The machine will validate the solution and assign 15minutes onto it which will do for a person to his vehicle to the nearest leave gate.
Advantages of AIRPORT PARKING System
The automated car parking system escalates the number of cars that may be parked in a garage area. It provides more parking spots since the vehicles are well organised parked.
If you use automated parking system, you will need only a less portion of land for creating a garage.
This system permits safe parking of cars when compared with the ramp-style parking facilities.
This approach to auto parking is so convenient for the motorists and they need not have to walk in search of parking spaces.
This system reduces the maintenance costs of the garages since it significantly reduces the ventilation and lamps requirements no need of costly deck vehicle repairs as well.
As said before, the chances of vehicle getting destroyed due to improper parking are considerably reduced in automated car parking system.
With automated airport parking system, there are no or very little chances of the vehicle getting lost. But, this is not the situation in traditional auto parking method.
Existing Car parking System
In many towns today, several car parking systems can be found in different auto parking areas or complicated. The auto parking systems help both users and the motorists to truly have a conducive and free environment for his or her auto parking activities using. Thus, the writer has made a decision to choose the next car parking system to compare for his overview of the prevailing systems:
Sunway pyramid airport parking system
C:\Images\Kk\27042010074. jpg
Figure 1. 1: slot machine game, (Sunway, 2010).
Some facility mounted on the system
C:\Images\Kk\27042010077. jpgC:\Images\Kk\27042010075. jpg
Figure 1. 2: car parking space, (Sunway, 2010).
Left picture-reserved lot(red light) right picture-available space(inexperienced light)
Car Playground Occupancy Information System (Cash)
Figure 1. 1 http://www. iaeng. org/IJCS/issues_v35/issue_1/IJCS_35_1_02. pdf
Lowyat car parking system
The Author is going to use some requirements to compare and evaluate the existing systems. The criteria are:
Information on available space:
This is dependant on the info provided by each system on the available space inside each of the auto parking area.
Reliability:
This will determine how reliable is the machine to its users. The services it offers both to the admin and customers.
Information on the amount of cars:
The information each system provide how many autos are inside each of the parking area.
Help and Support:
This basic principle will be used to evaluate the machine capacity to provide customer care through different means available.
Reservation:
The criteria used to assign a particular lot to a particular parson such as administrator or for other purposes.
Using the aforementioned evaluation criteria, the writer is going to compare the systems using 3 as the highest value and 1 as the cheapest.
S/N
Criteria
Sunway
Lowyat
COINS
I.
Information on available space
3
1
2
II.
Reliability
3
2
2
III.
Information on the number of cars
2
2
2
IV.
Help and Support
3
1
2
V.
Reservation
2
1
1
Table 1. 0 Comparability on the prevailing airport parking systems
Strengths of Existing Systems
The user interface design of the majority of the systems is made simple and rare advertisements are displayed. This permits users to execute their activities effectively.
There is not a restriction or limitation of energy for a car to invest in each parking area.
All the machine provide very reasonable price to the customer. The charges are bottom on time spend by a car in the car parking area.
Limitations of the prevailing Systems
None of the system is providing the information of every car (plate quantity). For security goal. For example security agency want know the automobile that are inside the car parking area for traceability.
The system do not assign car to a specific parking lot which bring about roaming of vehicles inside the area in looking of parking space.
Some of the system does synchronize the free car parking zones after the holiday of vehicle.
Possible Solutions
The possible way to resolve those problems is by using the computer-based system with some additional features or functionality. Some of the features are:-
Assigning the bay quantity to an automobile from the entrance gate
Synchronizing the free parking zones following the vacation of every car.
To get rid of the long going of vehicle by assigning the car to the nearest possible great deal.
The use of sensor at each great deal can be prevented because the car is being assigned to a particular whole lot. There by reducing the expense of developing and the cost of maintaining the area.
Also like mentioned in the study of Cash system light is very imperative to sensor because it helps in detecting the presence of vehicle. Insufficient light will cause the system to perform improperly. However in the truth computer foundation system all of this will not be one factor.
Summary
From the research and comparisons being conducted by the writer on several types of the car parking systems, the author have come to comprehend clearer the standards used to guage and rank parking systems online. Hence, the analysis has educated the author a great deal about airport parking systems and exactly how they operate. The issues being identified by the writer in the existing systems has made clear what problems should be averted in this task to make it unique, appropriate, and user-friendly.
CHAPTER 2. 0 SIMULATOR
2. 1 Introduction
The term simulation is thought as the process of fabricating an abstract representation of a preexisting or proposed system to be able to identify and understand those factors which control the system and/or to anticipate or forecast the future behavior of the system. Nearly every system which is often quantitatively discussed using equations and/or rules can be simulated.
The essential reason for simulation is to shed light on the fundamental mechanisms that control the tendencies of something. More virtually, simulation can be used to determine you skill to affect that future behavior. That's, simulation can be used to forecast how the system will establish and respond to its surroundings, so as to identify any necessary changes that will assist make the system perform just how that you want it to. (Goldsim 2010)
An example of a use of your computer simulator might be an anatomist company working on designing a better wing for aircraft. Rather than spending resources producing prototypes of every new design, and tests them in wind flow tunnels or on real airplane, a simulation can be run as an alternative. (wisegeek, 2003)
Computer simulation is the self-discipline of designing a style of a genuine or theoretical physical system, executing the model on a digital computer, and studying the execution output. To understand actuality (certainty) and all of its complexity, we should develop artificial things and dynamically react out assignments with them. Computer simulation is the digital counterpart of the type of role performing and it provides to drive artificial environments and online worlds. (wisegeek, 2003)
Simulation of a system can be carried out at a variety of degrees of fidelity so that whereas one will think of physics-based models and outcome, another may think of more abstract models which yield higher-level, less thorough output as in a queuing network. Models are made to provide solution at confirmed abstraction level. The more in depth the model, the more descriptive the output. The kind of output you will need will imply the sort of model you will employ. (wisegeek, 2003)
Simulation Technique
To simulate something physical, you will first need to make a numerical model which represents that physical object. Models can take many forms including constraint, declarative, useful, spatial or multimodal. A multimodal is a model containing multiple built in models each which represents a level of granularity for the physical system. The next process, once a model has been developed, is to invoke the model on a computer that is, you will need to make a computer program which steps through time while updating their state and event parameters in your model. There are several ways to step through time. You are able to, for instance, jump through time using event scheduling or you can employ small time increments using time slicing. You can also simulate the program on a massively parallel computer. This is called distributed and parallel simulation. For many large-scale models, this is the only possible way of getting answers in an acceptable amount of time.
When to make use of Simulation
Simulation is a conclusion examination and support tool. Simulation software enables you to examine, compare and maximize other designs, plans and regulations. As a result, it provides a tool for explaining and defending decisions to a number of stakeholders.
Simulation should be used when the penalty of a proposed action, plan or design cannot be straight and immediately noticed (i. e. , the consequences are delayed in time and/or dispersed in space) and/or it is merely impractical or prohibitively expensive to check the alternatives directly. For instance, when developing a strategic arrange for a firm, the impacts will probably take calendar months (or years) showing up.
Simulation is particularly important when there is certainly significant uncertainty regarding the outcome or consequences of a specific alternative in mind.
The the truth is not available (the technology is not in place to realize the idea)
The the truth is too dangerous (safe practices critical test)
To save money and time (development) (VIP, 2010)
Perhaps most importantly, simulation should be utilized when the system in mind has complex connections and requires the insight from multiple disciplines. In this case, it is complicated for any one individual to easily understand the machine. A simulation model can act as the framework to assimilate the many components in order to raised realize their interactions. Therefore, it becomes a management tool that will keep you concentrated without getting lost in unimportant details.
Types of Simulation
Parallel simulation
Parallel discrete event simulation is concerned with execution on multiprocessor computing platforms including multiple central handling systems (CPUs) that interact frequently, e. g. , a large number of times per second (PARALLEL AND DISTRIBUTED SIMULATION SYSTEMS, 1997).
2. 3. 1. 1. Example of parallel simulation is parallel simulation system for freeway traffic moves which has been developed with a network of Computers under the Windows. NET environment. Basic section types of a freeway were accepted and existing macroscopic models were customized for each portion type. The parallel algorithm first divides the complete section of a given freeway into multiple subsections depending on the number of PC's available in a network and the computational complexity of every subsection. Flows of every traffic sub section are simulated in parallel and the data at the inner restrictions between two consecutive subsections are exchanged by having a communication function at every time step.
Distributed simulation
Distributed simulation is concerned with the execution of simulations on loosely combined systems where interactions take a lot more time, e. g. , milliseconds or even more, and appear less often. It offers execution on geographically sent out computers interconnected via a extensive area network including the Internet (PARALLEL AND Allocated SIMULATION SYSTEMS, 1997).
In both conditions the execution of a single simulation model, perhaps made up of several simulation programs, is allocated over multiple pcs.
Benefits of Simulation
Parallel and distributed simulation systems can provide substantial gain to these applications in a number of ways:
1. Execution times of analytic simulations can be reduced by subdividing a big simulation computation into many sub-computations that can execute concurrently. You can decrease the execution time by up to a factor equal to the number of processors that are used. This can be important simply because the simulation requires a very long time to Execute, e. g. , simulations of communication networks containing thousands of nodes may necessitate days and nights or weeks for a single run.
2. Extremely fast executions are necessary for on-line simulations since there is often very little time available to make important decisions. Oftentimes, simulation results must be produced in seconds for simulation leads to be useful. Again, parallel simulation provides a methods to reduce execution time.
3. Simulations used for digital environments must do instantly, i. e. , the simulator must have the ability to simulate a second of activity in another of wall structure clock time so the virtual environment appears realistic in that it evolves as speedily as the genuine system. Distributing the execution of the simulation across multiple processors can help accomplish that property. Ideally, scalable execution can be obtained whereby the sent out simulation continues to run in real time as the system being simulated and the amounts of processors are increased in proportion.
(PARALLEL AND Allocated SIMULATION SYSTEMS, 1997).
Time Parallel Simulation
Time-parallel simulation methods have been developed for attacking specific simulation issues with well-defined objectives, e. g. , calculating the loss rate of the finite capacity queues of your ATM multiplexer (PARALLEL AND Sent out SIMULATION SYSTEMS, 1997). Time-parallel algorithms divide the simulated time axis into intervals, and assign each period to another processor. This allows for massively parallel execution because simulations often span long periods of simulated time.
A central question that must definitely be resolved by time parallel simulators is guaranteeing the claims computed at the "boundaries" of the time intervals match. Specifically, it is clear that their state computed by the end of the period [Ti-1, Ti] must match the state at the beginning of interval [Ti, Ti+1]. Thus, this process relies on having the ability to perform the simulation corresponding to the ith interval without first doing the simulations of the preceding (i-1, i-2, . . . 1) intervals.
Because of the "state-matching" problem, time-parallel simulation is absolutely more of a strategy for developing massively parallel algorithms for specific simulation problems than a general approach for executing arbitrary discrete event simulation models on parallel personal computers. Time parallel algorithms are currently not as powerful as space parallel strategies because they rely on specific properties of the system being modeled, e. g. , specs of the system's habit as recurrence equations and/or a comparatively simple status descriptor. This process is currently limited by a handful of applications, e. g. , queuing sites, Petri nets, cache remembrances, and multiplexers in communication sites.
(PARALLEL AND DISTRIBUTED SIMULATION SYSTEMS, 1997).
Smart Tools
The most basic reason behind which people choose smart tools is usually to be able to automate simple things, for example like in the smart homes lighting, heating and air conditioning controls. So that it is in the booking of plenty and assigning of auto parking lot in the automobile parking complex.
Another essential requirement coming from the usage of a good tools simulator is energy saving.
Smart tools could be divided into two main categories:
Programmable tools - are those designed to execute an action prompted by an type detected,
Intelligent tools - are those that possess some kind of intelligence that govern its operation. (Smart House Simulation Tool, 2006)
2. 1 Programmable tools
Programmable tools will be those, whose reactions are based only on simple inputs, and have got no built-in cleverness. Such an instrument for a predefined source (from either sensor(s) or user controller(s)) has a predefined (programmed) set of actions to execute. Types of such activities might be e. g. recognition of car at an entry of car parking area, or collection of parking areas. All these are predefined configurations by a user in system.
Virtually most of currently made and sold 'smart tool' systems participate in this group. With mass creation it was possible to lower the end-user price to a level appropriate by middle-class customers - cost can lay between 50 and 120 (or more) Euro per square meter (poradnik 2006), depending on a set of desired features and handled operations.
The biggest problem with this type of smart tools is that they have to be reprogrammed when a few of the features become pointless and/or added. That presents a problem for many individuals and requires getting in touch with a technician to get the job done. Hence increasing tension to develop some smart tools solution that - basing on artificial brains - will modify its operation to changing consumer behaviour. An instrument that will not have to be first programmed and then reprogrammed all the time. A tool that will think how to make a user satisfied, lower his workload and lower the tool operation cost at exactly the same time.
That tension contributes to development of the tool that is one of the second category.
2. 2 Intelligent Tools
They represent the state-of-the-art technology. Those kind of installations are motivated by artificial intelligence, and rather than having to be programmed they are able to learn (i. e. program themselves) basing on observation of inhabitants behaviour over a period.
It one of the first successful implementations was well known Adaptive House produced by M. Mozer at University of Colorado back in 1998.
Complete system could be decomposed right down to building blocks, which could be grouped into pursuing categories:
Data mining
Decision making
2. 2. 1. Data mining
It is an area known from e. g. figures or pattern reputation. It could be defined as searching large amounts of data for patterns.
In circumstance of intelligent auto parking system, it will be implemented as searching for a specific behavior design through the preserved logs of earlier activities, and striving to match the specific situation to a recently witnessed one.
One problem is that constantly growing amount of data (from actuators operation) demands a method for storage permitting short data gain access to time. Second problem is to fine tune a strategy to 'mine' the data out from the database, so that it can be employed by the next stage of the smart car parking system. Several ways to perform these businesses are presented with some details in (Causal Reasoning for Alert Generation in Smart Homes, 2006).
Having (possibly close) matched up the current scenario to 1 from days gone by, that module goes by the data to another, a lot more complicated module that is accountable for making decisions.
2. 2. 2. Decision Making
The role of the Decision Making section is, as name suggests, to make a decision of what action should be taken by the system, basing on the type from receptors and data given by data mining unit. There is enough of logic that may be integrated here. Decisions have to be performed effectively, because some everyday routine situations can be probably dangerous.
Second aspect is producing logic for smart system is a major task, far beyond the ability of a single person, and is meant to be completed by several researchers, in almost all of the cases they are simply university researchers.
2. 3 Smart Tool System/Simulator In Car Park
Smart tool systems focus on providing assist with both admin and customer while they can be dealing with the daily routine. Most simple alternatives control only the diagnosis of car and time at entry, then issue solution to the drivers, basing on pre-programmed configurations or simple suggestions. With adding more types of actuators operating new sorts of devices we can increase number of features inside our smart tool of airport parking system, enabling it to regulate more areas of system procedures, like reservation of space, taking car number and converting it to the editable format which may be as one of the details in recognizing the automobile and the driver, and provision of security. The main expansion, still being in experimental stage and looking forward to deployment in broad scale, is utilizing intelligence to acquire data from this complicated inputs, process them, and control system in an adaptive way.
Those are the features essential to create a good tool. In case there is creating a good tool simulator, many things are simpler. We do not have to create the whole complex infrastructure, because action takes place on the computer display. However, we must give user ways to define an instrument outline, to put and configure inputs, and a platform to simulate all events taking place in the automobile parking organic.
2. 4 Requirements for the Simulator
The smart tool simulator is meant to fulfill the following conditions:
1. Ought to be easy to use, to catch the attention of possibly broadest audience.
2. Should enable defining an instrument format, so that end user can define an instrument on his choice, instead of playing only with built-in themes.
3. Should permit individual to bind a specific action to specific input (basic rule of operation of a programmable tool). Example: drivers entering the area is found by pressing the button, and then the operation automatically starts off. (Smart House Simulation Tool, 2006)
Advantages of Simulation
Simulators are able to provide users with functional feedback when making real world systems. This allows the developers to look for the correctness and efficiency of your design prior to the system is in fact constructed. Consequently, the user may discover the qualities of alternative designs without actually bodily building the systems. By looking into the consequences of specific design decisions during the design phase as opposed to the development phase, the overall cost of building the system diminishes significantly.
Simulators permit system designers to review problems at a number of different levels of abstraction. By getting close to a system at a higher level of abstraction, the artist is better able to understand the actions and interactions of all the high level components within the machine and is therefore better outfitted to counteract the difficulty of the entire system. This difficulty may simply overpower the creator if the challenge have been tackled from a lower level.
Simulators can be used as an effective way for coaching or demonstrating principles to users. This is especially true of simulators that make intellectual use of computer images and animation. Such simulators dynamically show the action and relationship of all simulated system's components, in so doing providing the user with a significant knowledge of the system's character. (Donald, 1996)
Disadvantages of simulation
Expensive to build a simulation model.
Expensive accomplish simulation.
Sometimes it is difficult to comprehend the simulation results.
(Meng Xiannong 2002)
Importance of simulation
You may ponder whether simulation can be used to study vibrant systems. Simulation is often essential in the next cases:
The model is very complex with many parameters and interacting components. E. g. air travel simulator.
The underlying variables associations are nonlinear
The model is made up of random types. E. g. Science-based simulations
The model end result is usually to be visual just as a 3D computer animation.
(IST 2010).
The ability of simulation is the fact that, even for easily solvable linear systems a consistent model execution technique can be used to work out a sizable variety of systems without resorting to a "bag of steps" where one must choose special goal and sometimes incomprehensible solution solutions to avoid simulation (The Art and Technology of Digital World Engineering, 1995).
Another important characteristic of the simulation approach is that one may build a simulation model to replicate the real system. When someone uses the closed-form way, the model is sometimes twisted to suit the closed-form nature of the solution method alternatively than to accurately symbolize the physical system. A harmonious concession is to handle system modeling with a cross types way using both closed-form methods and simulation. For example, we might initiate to model something with closed-form examination and then improve later with a simulation. This evolutionary system is often quite effective (The Artwork and Research of Digital World Construction, 1995).
Conclusion
In this chapter, benefits of smart tool solutions were outlined, as well as a brief classification of available solutions. Variation between programmable tool and wise tool were discussed, basing mainly on the occurrence or lack of a self-learning logic unit, trying to fit the car playground infrastructure procedure to inhabitant habit which could change as time passes. Features integrated in current projects were discussed and summarized, and given as a short requirements list such a smart car park simulator should match. Those requirements will be looked at in the look issues that will observe later in the task.
Parallel and sent out simulation technologies solve issues regarding the execution of simulation programs on multiprocessor and distributed computing systems. These solutions find applications in powerful computing contexts as well as in the creation of geographically distributed virtual conditions.
CHAPTER 3: MULTITHREAD
Introduction
In this chapter the Author is going to discuss on multithreading. Multithreading is the strategy that support two or more thread of the same program to perform concurrently. This may occurred in the java program and can assist in managing the experience of the car parking sophisticated gate. Because most of these types of complex are having two gates, one of the gate it is use for the access and other for the exit. This may only be happen, unless the runner is a Java program, because two elements of the same Java program can run concurrently by using multithreading. The writer is going to discuss about multithreading and how to run elements of your program concurrently in this section.
Processes
A process is a heavyweight entity that lives inside the kernel. It consists of the stack, data, address space, registers, ram maps, document descriptors, kernel areas, virtual memory, user IDs, and so forth. (mswspt, 2010).
Threads
A thread is a light and portable entity that can reside in the user space or the kernel and includes registers, stack, and data. Multiple threads send out an activity, that is, they show the address space, file descriptors, user IDs, virtual storage, and so on. The threads included by a process share data, plus they can see each other. (mswspt, 2010).
A thread can be in one of four states:
Running A thread is being executed.
Suspended Execution is paused and can be resumed where it remaining off.
Blocked A resource cannot be accessed because it will be utilized by another thread.
Terminated Execution is ended and cannot be resumed.
All threads aren't the identical (same). Some threads tend to be essential than other threads and are supplying higher goal to resources such as the CPU. Each thread is given a thread concern that is employed to choose when to change from one performing thread to another. That is called context turning (Intelligent Transport Systems, 2007).
A thread's concern is comparative to the concern of other threads. That's, a thread's top priority is unrelated if it's the only real thread that is jogging. A lower-priority thread works equally as fast as a higher-priority thread if no other threads are performing at the same time.
When the rules of context switching are being applied thread priorities are utilized. These guidelines are:
A thread can willingly deliver to some other thread. In doing so, power is turned over to the highest-priority thread.
A higher-priority thread can prevent a lower-priority thread for use of the CPU. The lower-priority thread is paused regardless of what it's doing to give way to the higher-priority thread. That is called preemptive multitasking.
Threads of the same goal are processed predicated on the rules of the operating-system that is being used to run the program. For instance, Windows uses time slicing, which involves supplying each high-priority thread a few milliseconds of CPU cycles, and maintains revolving among the high-priority threads. In Solaris, the first high-priority thread must willingly yield to another high-priority thread. If it doesn't, the second high-priority thread must await the first thread to terminate (Intelligent Transportation Systems, 2007).
Multi process Programming
Running multiple functions concurrently is named multi process encoding. The processes can share data through distributed memory, database, memory space maps, files, and so on. (mswspt, 2010).
Multithreading
Multithreading is a conceptual encoding paradigm where a program (process) is divided into two or more subprograms (operations), which may be implemented at exactly the same time in parallel. (Multiple threads/flows of execution in the same program at the same time).
E. g. one subprogram can display an animation on the display while another may build another computer animation to be exhibited. Unlike almost every other computer languages, Java provides built-in support for multithreaded development. A multithreaded program consists of 2 or even more parts that can run concurrently. Each part of such an application is named a thread; each thread identifies a separate way of execution. Thus, multithreading is a kind of multitasking.
Different from multitasking
Supported by virtually all modern OS - 2 multitasking types:
processed-based: allows computer to perform 2/> programs concurrently
thread-based: a single program can perform 2/> tasks simultaneously
Advantages of Multithreading Over Multi process Programming
A thread is light weight, so many threads can be created to use resources effectively. The threads are contained by an activity so they can promote global data. A preventing demand (request) by one thread won't stop another thread from executing its task. Also, the process will not get context-switched because a thread is blocked.
The consequence of multithreading is increased performance, increased throughput, improved responsiveness, the capability to execute tasks regularly, better efficiency, better management of resources, and decreased costs. A thread context-switch is immensely fast and can be at the kernel central processing device (CPU) level or in individual space.
A process is long-lasting, so that it costs more to context-switch a process than a thread. Multithreaded coding is a lot easier than multiprocess encoding, performance is faster, and management of resources is easy. Also, synchronization and distributed memory use will be more hard with techniques than with threads, because threads talk about memory at the process level and global storage access is not hard with threads. (mswspt, 2010).
Reason for Build Multithreading In Products
A multithreading strategy allows an organization to offer products that can deliver better performance, which reduces customers' total cost of ownership (TCO). Such products may take good thing about parallelism in hardware through SMP or CMT to implement many responsibilities in parallel, which will the following, among other things:
Reduces computation time
Improves performance
Improves responsiveness
Enables better interaction between users and multithreaded applications
Increases efficiency when handling resources
Reduces a chance to market
Reduces recruiting costs
Provides portability
Improves users' perceptions of the products
Increases competitiveness
Reduces contentions for resources such as OS buildings, disk, memory space, CPU, and so forth (mswspt, 2010).
Techniques found in Multithread
Multitasking
Multitasking is carrying out two or more tasks at the same time. Nearly all operating systems are capable of multitasking by using 1 of 2 multitasking techniques: process-based multitasking and thread-based multitasking (O'Reilly, MA 1997).
Process-based multitasking is performing two programs concurrently. Process is referred as an application by programmers. Because of this, you may say that program-based multitasking is process-based multitasking.
Thread-based multitasking is having a program execute several tasks at exactly the same time. For example, a word handling program can confirm the spelling of words in a file while you write the report. This is thread-based multitasking.
A simple way to differentiates between process-based multitasking and thread-based multitasking is to think about process-based as working with multiple programs and thread-based as dealing with parts of one program.
The purpose of multitasking is to use the idle time of the CPU. Think about the CPU as the engine unit of an automobile. The engine continues running whether or not the car is moving. Your target is to keep your vehicle moving as much as possible so you can get the most a long way from a restricted of gas. Engine motor that idles wastes gas.
The same theory applies to the CPU in your computer. You want your CPU cycles to be producing data and instructions rather than looking forward to something to process. A CPU pattern is somewhat like your engine running.
CPU idles more than it functions in many desktop personal computers, but the It might be hard to trust. Let's assume that you will be using a expression processor to write a doc. The CPU is idle until you get into a figure from the key pad or move the mouse generally. Multitasking is supposed to use the fraction of a second between strokes to process instructions from either another program or from a different area of the same program.
Making efficient use of the CPU might not be too significant for applications running on a pc because most of us seldom need to perform concurrent programs or run elements of the same program at the same time. However, programs that run in a networked environment, such as the ones that process deals from many pcs, need to produce a CPU's idle time successful.
Synchronization of multithread
Multithreading occurs asynchronously, meaning one thread executes in parallel of the other threads. In this manner, threads don't be based upon each other's execution. In difference, processes that run synchronously be based upon each other. That's, one process waits until the other process terminates before it can perform.
At times the execution of an thread is reliant on the execution of another thread. Let`s say you have two threads. The foremost is handles gathering login information, and the other validates a user's ID and password. The login thread must await the validation thread to complete handling before it can notify the user whether or not the login is successful. Therefore, both threads must execute not asynchronously, but synchronously.
Java gives you to synchronize threads by making a synchronized method. A thread that is at a synchronized method defends other thread from calling another synchronized method on the same object.
How Multithread works
A thread is part of an application that is running. Thread-based multitasking has several threads operating at the same time (that is, multiple elements of a program performing concurrently). Each thread is a separate path of execution.
As this is of multithreading implies, it is a conceptual programming paradigm in which a program (process) is divided into two or more subprograms (operations), and which can be implemented at the same time in parallel. A multithreaded program is made up of 2 or even more parts that can run concurrently. Each part of such an application is called a thread; each thread identifies a separate avenue of execution. A program which has multiple moves of control is recognized as multithreading.
As regarding parking system, there could be a situation where a one car is joining and another is this exiting at same time, which means two responsibilities are happening at exactly the same time both action are developing parallel and concurrently and will not depend on each other. That means an example may be for the entry and another is ideal for leave. Another situation is when the admin is monitoring the traffic of the region; at least three threads are working simultaneously. You are one which reading the vehicles that are going into, another is the one which is running the time and the other is one which is keeping track of the cars that exited. So admin can adjust either of the thread in other reduce or control the traffic. And in addition there other thread which holding the Thus, multithreading is a form of multitasking.
Different from multitasking
Supported by virtually all modern OS - 2 multitasking types:
processed-based: allows computer to perform 2/> programs concurrently
thread-based: a single program is capable of doing 2/> tasks simultaneously
Threads execute in the same data space. If global adjustable changes in a single thread, all other threads will observe the change.
The ability of a language to support multithreads is referred to as concurrency. The threads in java are subprograms of a main program program and show the same storage area space
A multithreaded program enables developers to do multiple things at one time. They can split an extended program into threads and implement them in parallel. This will improve the acceleration of our programs.
(Realtime and concurrent, chafter 5. 2010).
Advantages and Cons of the Multithread
Before embarking on an idea to uses these techniques, the Author investigate on it is important and understand it is potential benefits and pitfalls.
Advantages of an Multithread
Improved performance and concurrency
For certain applications, performance and concurrency can be better by using multithreading. In other applications, performance can be unaltered or even degraded by using multithreading.
Simplified coding of distant procedure phone calls and conversations
In some applications it is easier to code different remote control procedure calls and discussions in split threads than to control them from the same thread. (BEA, 2000)
Disadvantages of your Multithreaded
Difficulty of writing code
Multithread program is not easy to write. Only experienced developers should attempt coding for these kind of applications.
Difficulty of debugging
It is a lot harder to replicate an error in a multithread software than it is to take action in a single-threaded, single-contexted program. Because of this, it is more hard and difficult, in the previous case, to identify and verify main causes when mistakes occur.
Managing concurrency is difficult
The process of running concurrency between threads is difficult and gets the possible to bring in new problems into a credit card applicatoin.
Difficulty of testing
Testing a multithreaded program is more difficult than testing a single-threaded application because defects tend to be timing-related and more difficult to replicate. (BEA, 2000)
Problems with Multithreading
If several thread manipulates shared variables or items at the same time, corruption may effect. Variables of example are distributed between threads. The change impacts the other threads if one is modified by the thread. Method parameters are unique for every single thread. Each of the thread has its copy.
Solution
A way to avoid data from being corrupted by multiple threads is to prevent the interruption of critical parts. Critical parts are places like num=num+10 above, where only 1 thread should be operating simultaneously. Java's synchronized can be used to ensure that only 1 thread is in a crucial region simultaneously. When the thread enters a synchronized code stop, it tries to get a lock on that region. As the thread is in the critical region, no other thread can enter in the critical region. If a thread tries to enter and the code has already been locked, the thread must await the other thread to leave the critical region. This is preset by synchronizing the usage of num synchronized (this) ensures that only 1 thread can be in the next code block. The truth explains to the thread to make use of the lock because of this object (Intelligent Travel Systems, 2007).
A critical region is utilized to copy num to temporary safe-keeping. The string is then paper using the temporary storage. It could have been possible to synchronize the printing line directly, but it could cut performance because the print line does many other things which have nothing to do with referencing num. All of the threads waiting to type in the critical region will needlessly hold out longer while the print collection is executed. Generally, the synchronized blocks should be no more than possible while still safeguarding the critical region.
Conclusion
In this section, the Author recognizes specific uses of threads that can be expanded to standard use. Most threading problems can be resolved by using little variations. If threads need to talk to each other, care must be studied to avoid data problem. Looked after shows how data problem and the steps that must definitely be taken to avoid it. Again it illustrates how two threads can be synchronized in order to do things in the right order. Finally, it shows many of the delicate problems in a multithreaded environment. If threads in an applet compete for common resources, a deadlock may appear unless good care is taken to avoid it.