Celebrating Linux 20th Anniversary

13 Apr 2011

Celebrate 20 Years of Linux

Credit: Linux Foundation

As of April 2011, Linux is about 20 years old from its inception in 1991. Linux is free and open source operating system developed by Linus Torvalds. Minix is the inspiration’s of Linux. Minix is developed by Andrew S. Tanenbaum purposely for education. There a long debate between Tanenbaum and Torvalds on their architecture to design their operating system. Minix is using Microkernel while Linux is using  Monolithic Kernel. Because Linus Torvalds decides to push Linux source code under GNU General Public License, finally, Linux gets outstanding success by having a lot of contribution from kernel developers around the globe.

Continue Reading »

No responses yet

Token Ring: Mutual Exclusion in Distributed Systems

08 Apr 2011

Token Ring Mutex

Token Ring Mutex

Token ring is one among mutual exclusion algorithm in distributed systems that does not involve with a server or coordinator. A token is passed from one node to another node in a logical order. A node received token has a proper right to enter the critical section. If a node being holding token does not require to enter critical section or access a shared resource, it just simply passes the token to the next node.

Continue Reading »

No responses yet

Distributed Algorithm: Mutual Exclusion in Distributed Systems

06 Apr 2011

Distributed Algorithm in Mutex

Distributed Algorithm in Mutex

Distributed algorithm in mutual exclusion takes advantage of multicast protocol to broadcast the requested message to enter the critical section. Once a node sent requested message to every node on the network, every node must send back a message stated that it allows that node to enter the critical section. The node sent requested message must receive a gaining access message from every node on the network before it can actually access to a shared resource. If one node fails to send a gaining access message, then the node cannot access the shared resource.

Because there is no centralized coordinator, it is likely that two or more node send request message simultaneously. However, logically the arrival time stamp of each request message is never been the same. We can use Lamport clock algorithm for this scenario.

Continue Reading »

No responses yet

Centralized Algorithm: Mutual Exclusion in Distributed Systems

04 Apr 2011

Centralized Algorithm in Mutex

Centralized Algorithm in Mutex

Semaphore and Monitor that protected critical section in single system are no longer appropriated in distributed systems. So in distributed systems, we must use a special algorithm to achieve mutual exclusion. There are 3 basic algorithms to be considered and work as a baseline for developing another mutual exclusion algorithm in distributed systems. Those 3 are:

  • Centralized algorithm
  • Distributed algorithm
  • Token ring algorithm

Prerequisite

Please refer to these articles for better understanding of mutual exclusion:

Continue Reading »

No responses yet

Monitor: Mutual Exclusion in Single System

01 Apr 2011

Monitor

Monitor

Monitor and Semaphore is somehow the same. However, monitor adds more abstract layer to semaphore. Semaphore refers to operation level while monitor refers to class level which is the combination of many operations and variables.

Monitor

By definition, a monitor is a collection of procedures and data that are all grouped together in a class. Just as semaphore, monitor ensures that a particular thread can exclusively access to a shared resource at a specific time. Monitor may implement semaphore and condition variable over the critical section to provide the best total single flow of modifying the resources.

Continue Reading »

One response so far

Semaphore: Mutual Exclusion in Single System

29 Mar 2011

Semaphore

Semaphore

Mutual Exclusion is required both in single system and distributed systems to protecting the shared resource from being modified concurrently. In this article, we will discuss the mutual exclusion in single system by using Semaphore. Finally we will follow by giving Java example. Before reading this article, it is highly recommended you read the Principle of Mutual Exclusion.

Semaphore

Semaphore is a flag that railroad engineers would use when trains enter a shared track. Semaphore here refers to a mechanism to ensure only one thread or process to access a shared resource. To implement semaphore in Java, synchronized(this) keyword should be used to surround critical section. The code from previous article will look like this.

Global variables

int x = 6;
int y = 0;

FooThread

void foo(){
  synchronized(this){
    x++;
    y = x;
  }
}

BarThread

void bar(){
  synchronized(this){
    y++;
    x += 3;
  }
}

Continue Reading »

2 responses so far

Principle of Mutual Exclusion

28 Mar 2011

Mutual Exclusion is a process that prevents multiple threads or processes from accessing shared resources at the same time. The problem is coming from the fact that in both distributed systems and single system, several threads or processes share a resource but cannot use it concurrently. Mutual Exclusion, Synchronization and Data Coordination are commonly use interchangeably; or just MUTEX for short.

Rationale

This will guide you to the root of the problem and give you solution.

Let see the two blocks of code that runs in parallel called foo() and bar().

The initial state: x=6 and y=0.

FooThread

void foo()
{
   x++;
   y = x;
}

BarThread

void bar()
{
   y++;
   x += 3;
}

Continue Reading »

2 responses so far

Web Application Testing System – Selenium

25 Mar 2011


Selenium

Selenium

Selenium is an open source for web application testing. Selenium is set of different software tools with each different approach to supporting test automation. A variant, Selenium Grid is a distributed systems for speeding up testing very large scale web application.

The main advantages of Selenium are:

  • Open source
  • Small learning curve
  • Cross browsers and platforms
  • Support many popular unit test frameworks and programming languages
  • Distributed testing on its grid

Continue Reading »

No responses yet

TCP UDP and RMI Performance Evaluation

22 Mar 2011

TCP UDP and RMI Throughput

TCP UDP and RMI Throughput

It is interesting to see the performance evaluation of TCP, UDP and RMI. This article shows the simple scenario to test their performance by looking at latency and throughput. The test result shows that RMI has poor performance compares to TCP and UDP. TCP and UDP has comparable result though UDP gains slightly higher than TCP.

From this work, I can draw conclusion that RMI is easy to implement the function based program but it is not good for intensive exchange packets. UDP and TCP are good for packet transmissions but they are hard to implement protocol. Though UDP has less overhead, it is not guarantee the packet delivery. At last, TCP is good for almost scenario with good administration.

Continue Reading »

6 responses so far

Java RMI Database Application

20 Mar 2011

Java RMI Database Application

Java RMI Database Application

Java RMI has been introduced to reduce the complexity in developing protocol that relies on UDP and TCP. Java RMI provides a simpler mechanism to invoke method remote. Here I will discuss the development of Java RMI with database application. This sample application is layered into 3 tier: client, RMI server or middleware, and database.

Client is very thin and lightweight. Here client is only responsible for user interface while large business processes are handed over to RMI middleware. The middleware contains server objects distributed in registry service. The client will lookup the entire object from the registry service and invoke methods remotely. Database server stands on another layer that will be accessed by the data accessors in RMI middleware.

If you do not understand what Java RMI is, better to have a look on these articles:

Continue Reading »

21 responses so far