A Framework for Distributed Pattern Matching Based on Multithreading

A Framework for Distributed Pattern Matching Based on Multithreading

30 The International Arab Journal of Information Technology, Vol. 9, No. 1, January 2012 A Framework for Distributed Pattern Matching Based on Multithreading Najib Kofahi and Ahmed Abusalama Department of Computer Science, Yarmouk University, Jordan Abstract: Despite of the dramatic evolution in high performance computing we still need to devise new efficient algorithms to speed up the search process. In this paper, we present a framework for a data-distributed and multithreaded string matching approach in a homogeneous distributed environment. The main idea of this approach is to have multiple agents that concurrently search the text, each one from different position. By searching the text from different positions the required pattern can be found more quickly than by searching the text from one position). Concurrent search can be achieved by two techniques; the first is by using multithreading on a single processor, in this technique each thread is responsible for searching one part of the text. The concurrency of the multithreading technique is based on the time sharing principle, so it provides us of an illusion of concurrency not pure concurrency. The second technique is by having multiprocessor machine or distributed processors to search the text; in this technique all of the processors search the text in a pure concurrent way. Our approach combines the two concurrent search techniques to form a hybrid one that takes advantage from the two techniques. The proposed approach manipulates both exact string matching and approximate string matching with k-mismatches. Experimental results demonstrate that this approach is an efficient solution to the problem in a homogeneous clustered system. Keywords: Pattern matching, online search algorithms, multithreading, concurrency, java space technology, distributed processing. Received April 7, 2009; accepted November 5, 2009 1. Introduction special features that can be used by pattern matching technique best suited for that area [24]. The problem of finding exact or non-exact occurrences This study presents a new approach to solve the of a pattern P in a text T over some alphabet is a problem of pattern matching depending on the idea of central problem of combinatorial pattern matching and search distribution over multiple connected nodes. At has a variety of applications in many areas of each node we adopt the multithreading paradigm to computer science [19]. String searching algorithms can speedup the searching process. By using be accomplished in two ways: multithreading and distributed search over connected 1. Exact match, meaning that the passages returned nodes the text can be searched concurrently from will contain an exact match of the key input. different positions. This will decrease the time needed 2. Approximate match, meaning that the passage will to find the required pattern. contain some part of the key word input [17]. For our implementation purposes, Java threads - a built-in parallelism support- is used to implement the Although the dramatic evolution of processor multithreaded approach. To implement the distributed technology and other advances have reduced search processing, we use the Java space technology, which is response to negligible times, pattern matching problem easy to implement and satisfy our problem still remains a useful area of research and development requirements. At each node in the distribution, the for a number of reasons. Firstly, as the size of data multithreaded approach works in a timesharing continues to grow, sequence searches will become manner. increasingly taxing on search engines. Secondly, the The rest of the paper is organized as follows. pattern matching still remains an integral part of faster Section 2 gives a brief introduction to string searching matching algorithms, typically comprising the final algorithms. In section 3, the subject of threads and part of a search. Lastly, researchers have to understand multithreading is introduced, and distributed the classical methods of pattern matching to develop computing and distributed algorithms are discussed in new efficient algorithms [12]. section 4. The main contribution of this research is With the developments of new pattern matching given in section 5: The multithreaded distributed techniques, efficiency and speed are the main factors pattern matcher. Implementation and experimental in deciding among different options available for each results are explained in section 6. The conclusions and application area. Each application area has certain future work is given in section 7. A Framework for Distributed Pattern Matching Based on Multithreading 31 2. String Searching Algorithms This study implements a multithreading text searching approach to improve text searching In general, there are two ways to search a text T to performance at a single CPU machine. The idea is to find a pattern P depending on weather the algorithm have more than one searcher thread that search the text performs some preprocessing on the text T or not. from different positions. Since the required pattern Depending on the problem domain, some of the may occur at any position, having multiple searchers is matching algorithms have to preprocess the text and better than searching the text sequentially from the build a data structure to aid in the search process. Such first character to the last one. algorithms are called indexers. (i.e., suffix arrays. suffix trees, and inverted files). Other algorithms directly perform the search on the text without any 4. Distributed Computing and Distributed preprocessing. Such algorithms are called sequential or Algorithms online search algorithms (i.e., Knuth-Morris, Boyer The new technologies of networking and the dramatic Moore, and Brute-Force) [28]. In this paper, we are evolution of the internet and intranet impacts the way interested in enhancing the online search algorithms. that we use computers and changes the way we create applications for them. Distributed applications are 3. Threads and Multithreading Motivation becoming the natural way to build software. “Distributed computing” is all about designing and A thread is simply a path of execution within a process building applications as a set of processes that are or it’s a low weight process [13]. In single threaded distributed across a network of machines and work applications, all operations, regardless of type, together as an ensemble to solve a common problem duration or priority, execute on a single thread. Such [8]. applications are simple to design and build and all Distributed algorithms are algorithms designed to operations are serialized. That means there is one run on a distributed system; where many processes thread running at a time. However, there are many cooperate by solving parts of a given problem in situations where it's useful to have multiple threads of parallel. For this purpose, the processes have to execution that run simultaneously based on the exchange data and synchronize their actions. In principle of timesharing [26]. contrast to so called parallel algorithms, Concurrency is very important in many computer communication and synchronization is solely done by applications, but most of the programming languages message passing -there are no shared variables- and do not enable programmers to specify concurrent usually the processes do not even have access to a activities. Rather, programming languages generally common clock. Since message transmission time provide only a simple set of control structures that cannot be ignored, no process has immediate access to enable programmers to perform one action at a time the global state. Hence, control decisions must be then precede to the next action after the previous one made on a partial and often outdated view of the is finished. The kind of concurrency that computers global state which is assembled from information perform today normally is implemented as operating gathered gradually from other processes [16]. system “primitives” available only to high experienced Distributing computing requires a tool by which the system programmers [7]. distributed machines can communicate. Many tools are Java is unique among popular general-purpose available such as Remote Method Invocation (RMI), programming languages in that it makes concurrency CORBA and Java Space. Each tool has its own primitives available to the applications programmer. specifications; the application designer chooses the The programmer specifies that applications contain appropriate one for his application requirement. threads of execution, each thread designating a portion of a program that may execute concurrently with other threads. Multithreading gives the Java programmer 5. The Multithreaded Distributed Pattern powerful capabilities that are not available in C and Matcher C++, the languages on which Java is based [7]. CPU can process only one instruction at time 5.1. Multithreading Approach (regardless to the pipelining technology). When a The main idea by using multithreading to solve the multithreaded application runs on a single processor pattern matching problem (on a single CPU machine) it's impossible to have a complete or pure parallelism, is to have multi searching threads that search the target but it gives us an illusion of parallelism depending on text simultaneously in a timesharing manner. Each the timesharing principle. The idea is behind the very thread starts searching the target text from different fast context switching between threads that can be position.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    9 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us