Method and system of processing a plurality of data...

Electrical computers and digital processing systems: multicomput – Computer-to-computer data routing – Least weight routing

Reexamination Certificate

Rate now

  [ 0.00 ] – not rated yet Voters 0   Comments 0

Details

Reexamination Certificate

active

06463480

ABSTRACT:

BACKGROUND OF THE INVENTION
1. Technical Field
The present invention relates to a multitask control method for processing a plurality of requests in parallel, and particularly to a method for supporting the construction of a multithread program.
2. Prior Art
Conventionally, to process a plurality of requests in parallel, a plurality of threads is created in a memory area managed by the system and a program is executed on a thread basis. The thread is the smallest execution unit existing in a process and characterized by a stack and a program counter. In an ordinary program, only one such execution unit exists, but, in a multithread program, a plurality of such execution units exists at the same time. That is, the concurrent execution of a plurality of processes is enabled, and it is an essential technique for developing server programs and the like.
However, in the prior art, as the functions of a server, the programmer needs to explicitly specify a facility for concurrently accepting client requests, and low-level instructions (API) for carrying out a processing for creating/deleting a thread, a synchronous processing among threads, and the like. Thus, the programmer is required to have a very high skill.
For instance, in the process for manipulating thread-specific data and global data, it is necessary to perform a programming shown below. In this case, it is exemplified by C++ (API of OS/2: “OS/2” is a trademark of IBM Corporation), which is one of programming languages. In this process, the Increment ( ) method of an Order object is invoked to increment a, a thread-specific variable, and simultaneously the result is stored in stock, a global object.
Stock *stock; //Global object, which is accessed from
a plurality
// of threads.
HMTX hmtx; // Semaphore handle for access to a global
object
main ()
{
stock=new Stock; //Creation of a global object
DosCreateMutexSem(“¥¥SEM32¥¥sem1”, &hmtx, 0, FALSE);
//Global object/semaphore for access...
while(!empty) { //Message loop for processing
//the request from client
Getmessage(&msg); //Calling of a message from a queue
switch(msg−> task) {
case NEW: //When the generation of an object is
requested from
// client,
_beginthread(TreadNew, NULL, NULL, msg);
//create a thread and execute a ThreadNew function.
break;
case INCREMENT: //An increment request from ciient
_beginthread(ThreadInc, NULL, NULL, msg);
//Create a thread and execute a ThreadInc function.
break;
case DELETE: //When the deletion of an object is
requested from
// client,
_beginthread(ThreadDelete, NULL, NULL, msg);
//create a thread and execute a ThreadDelete function.
break;
. . . .
}
}
}
ThreadNew (MESSAGE *msg)
{
Order *obj = new Order();
GlobalTable[msg−>clientID] = obj
//Create an object and registration it into a table to
associate
//the client ID with the created object.
}
ThreadInc(MESSAGE *msg)
{
Order *obj = GlobaleTable[msg−>ClientID];
//Take out the object associated with client.
Obj−>Increment();
//Invoke the Increment() method of the object.
}
ThreadDelete(MESSAGE *msg);
{
Order *obj = GlobaleTable[msg−>ClientID];
delete obj; //Deletion of an object
}
/*Definition of target object method*
*Describe only Increment() method. Omit constructor
and destructor*
/Order::Increment()
{
a = a+1 .. Increment of thread-specific data
DosRequestMutexSem(hmtx, SEM_INDEFINITE_WAIT);
//Request semaphore to perform exclusive control
//of a stock object.
Stock−>Store(a);      //Invoking of Store
method
DosReleaseMutexSem(hmtx);    //Release
semaphore.
}
Thus, in the conventional multithread server programming, the programmer had to manage all by himself the contention among threads and the timing of deleting an object. This led to the risk of causing waste of memory due to program errors or data mismatch due to the contention among threads. These factors could cause the system reliability and throughput to degrade, or cause the server system to halt at worst. In particular, if a programmer at a relatively low skill level develops a server application, it is an important problem to provide a high degree of isolation to threads so that the respective processings do not interfere with each other.
Further, since the programmer must always be careful not to cause such problems, he must spend sufficient time in test and debug, which causes a problem of reduction in the productivity of programs.
Furthermore, in developing a typical multithread program in which requests are received from a plurality of clients and processed in parallel, there is a problem that the individual processings may interfere with each other. That is, the interference may produce a wrong result even though the individual processings are correct. To avoid such problem and develop a safe program, it is necessary to separately process the requests of clients and prevent the individual processings from interfering with each other as much as possible. Such technique for easily achieving the isolation of the individual processings is desired.
In connection with such prior art problems, Published Unexamined Patent Application Nos. 4-204656 and 4-195228 disclose a technique for declaring thread-specific data in the same fashion as global variables by analyzing a program in which a plurality of threads exists, and holding a specific data area start address for each thread during the execution of the program. However, even in such technique, since the programmer had to manage all by himself the contention among threads and the timing of deleting an object, the waste of memory due to program errors and the data mismatch due to the contention among threads could not be avoided.
On the other hand, in the conventional multithread control method such as Published Unexamined Patent Application No. 4-321136, once a thread is created, a certain memory region is allocated, but, even if the CPU execution right is not provided, the memory region is maintained until the program ends, and thus resources are not effectively used.
SUMMARY OF THE INVENTION
It is an object of the present invention to obviate the necessity of giving low-level instructions when describing a multithread program capable of concurrently processing the requests from clients, and provide the programmer with an environment in which he can create a multithread program without requiring high skill, thereby to increase the productivity of programming.
It is a further object of the present invention to avoid the waste of memory due to program errors and the data mismatch due to the contention among threads, thereby to increase the system reliability and throughput.
It is still a further object of the present invention If to provide a multithread control method in which resources are effectively used.
To solve these problems, an object to be referenced only from a single thread (referred to as thread object) is introduced, and to hide multithread-specific low-level processings (e.g. management of threads, exclusive control, synchronization, etc.), they are provided in the form of component. With the thread object proposed in the present invention, a safe program having a high degree of thread isolation can easily be constructed. Further, in the multithread programming, it is deemed that thread management, protection of shared resources using semaphore or the like, synchronization among threads, and the like are difficult. In the present invention, by providing such multithread-specific low-level processings in the form of component, the program development can be eased.
Although the thread object is effective in writing a safe program, there may be a case in which data must be shared among threads. In the present invention, considering such point, another type of object called shared object is provided. Being different from the thread object, the shared object can be accessed

LandOfFree

Say what you really think

Search LandOfFree.com for the USA inventors and patents. Rate them and share your experience with other people.

Rating

Method and system of processing a plurality of data... does not yet have a rating. At this time, there are no reviews or comments for this patent.

If you have personal experience with Method and system of processing a plurality of data..., we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and Method and system of processing a plurality of data... will most certainly appreciate the feedback.

Rate now

     

Profile ID: LFUS-PAI-O-2996856

  Search
All data on this website is collected from public sources. Our data reflects the most accurate information available at the time of publication.