Apparatus, method, and program product for supporting programming

According to an embodiment, a computer system displays, on a display, a GUI dialog box that prompts an operator to set the identification name and thread type of a source file that describes source code of a thread. When the identification name and thread type of the source file are set via the GUI dialog box, the computer system acquires a source code template corresponding to that thread type, and reflects the identification name set via the GUI dialog box in that source code template. The computer system generates a source file with the identification name set via the GUI dialog box in the basis of the source code template. The computer system stores the identification name and thread type set via the GUI dialog box in a definition file as thread definition information of the source file set with the identification name.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is based upon and claims the benefit of priority from the prior Japanese Patent Application No. 2002-142472, filed May 17, 2002, the entire contents of which are incorporated herein by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to an apparatus, method, and program product, which support efficient programming of a multithread-compatible object program on a computer.

2. Description of the Related Art

A multithread-compatible object program (application software, utility software, or the like) can execute in parallel a plurality of processing units called threads. Upon programming such program product on a computer, source files for respective threads, and one definition file must be created. Each source file stores source code which represents execution contents of the corresponding thread. The source code is a design of software described using a programming language. The definition file stores thread definition information which defines execution conditions of respective threads.

After a programmer creates source files and a definition file on a computer, he or she launches a predetermined compiler. Then, the source files and definition file are compiled to generate a multithread-compatible object program. The compiler is software for converting the source codes into object codes. The object code is a program described in a machine language that the computer can interpret.

Conventionally, it is a common practice to create source files and a definition file using text file edit software called an editor. When this software is used, the programmer sequentially inputs source code and thread definition information as text data character by character by operating keys on a keyboard, thereby creating the source files and definition file. For this reason, the programmer must understand the meaning and way to use of each individual source code and thread definition information. Then, the programmer must describe the source code and thread definition information at appropriate locations of the source files and definition files in an appropriate order using text data with appropriate spelling.

A programming beginner must spend much time as well as learning time until he or she develops a program. Also, the text data input operation is troublesome and time consuming. In addition, compiling often fails due to input errors in the source code and thread definition information.

BRIEF SUMMARY OF THE INVENTION

It is, therefore, required to provide a programming support apparatus, method, and program product, which allow even a beginner to easily do programming jobs without any errors.

According to embodiments of the present invention, there is provided a programming support apparatus comprising:

a template file which stores templates of source code that are set in correspondence with types of threads;

a definition file which stores definition information of the thread;

means for displaying, on a display of a computer system, a GUI dialog box that allows to set. an identification name and thread type of a source file which stores the source code of the thread;

means for, when the identification name and thread type of the source file are set via the GUI dialog box, acquiring the template corresponding to the thread type from the template file;

means for reflecting the identification name set via the GUI dialog box on a source code of the template acquired from the template file;

means for generating a source file with the identification name set via the GUI dialog box on the basis of the source code of the template; and

means for storing, in the definition file, the identification name and thread type set via the GUI dialog box as thread definition information of the source file set with the identification name.

According to embodiments of the present invention, there is provided a programming support method comprising:

displaying, on a display of a computer system, a GUI dialog box that allows to set an identification name and thread type of a source file which stores source code of a thread;

acquiring, when the identification name and thread type of the source file are set via the GUI dialog box, a template corresponding to the thread type;

reflecting the identification name set via the GUI dialog box on source code of the acquired template;

generating a source file with the identification name set via the GUI dialog box on the basis of the source code of the template; and

storing, in a definition file, the identification name and thread type set via the GUI dialog box as thread definition information of the source file set with the identification name.

According to embodiments of the present invention, there is provided a programming support program for making a computer system execute steps of:

displaying, on a display of a computer system, a GUI dialog box that allows to set an identification name and thread type of a source file which stores source code of a thread;

acquiring, when the identification name and thread type of the source file are set via the GUI dialog box, a template corresponding to the thread type;

reflecting the identification name set via the GUI dialog box on source code of the acquired template;

generating a source file with the identification name set via the GUI dialog box on the basis of the source code of the template; and

storing, in a definition file, the identification name and thread type set via the GUI dialog box as thread definition information of the source file set with the identification name.

DETAILED DESCRIPTION OF THE INVENTION

An embodiment of the present invention will be described hereinafter using the accompanying drawings.

Note that this embodiment is applied to a case wherein programming of a multithread-compatible object program is supported on a computer system. In this embodiment, parallel execution of a plurality of processes by one object program is called a multithread process, and each individual processing unit is called a thread.

An outline of programming in this embodiment will be described first usingFIG. 1.

The first step of programming is creation of a source program2on a computer system1. The computer system1comprises, e.g., a personal computer, workstation, or the like. The source program2consists of source files3for respective threads, and one definition file4. Each source file3stores source code indicating the execution contents of the corresponding thread. The definition file4stores thread definition information that defines the execution conditions and the like of respective threads.

The second step of programming is compiling of the source program2by a compiler5. The compiler5compiles the descriptions of the source files3and definition file4into a compiler language.

Compiling the source program2generates an object program6as a desired object.

A support program7runs on the computer system1to support the first step of programming. The support program7includes a template file8. The template file8will be described later.

FIG. 2is a block diagram showing the principal hardware arrangement of the computer system1. The computer system1comprises a CPU (Central Processing Unit)11which forms a main controller, a ROM (Read Only Memory)12and RAM (Random Access Memory)13which form a main storage unit, an HDD (Hard Disk Drive) device14which forms an auxiliary storage device, and various input/output interfaces such as a keyboard interface15, mouse interface16, display interface17, storage medium interface18, and the like. The CPU11, ROM12, RAM13, HDD device14, and various input/output interfaces15,16,17, and18are connected to a bus line19which includes an address bus, data bus, and the like.

A keyboard15aon which character keys, numerical keys, a space key, an enter key, cursor keys, function keys, and the like are arranged is connected to the keyboard interface15. A display device17asuch as a liquid crystal display, CRT display, or the like is connected to the display interface17. A mouse16ais connected to the mouse interface16. The mouse16ais a pointing device used to move a pointer displayed on the screen of the display device17a. A storage medium18asuch as a flexible disk, CD-ROM, or the like is connected to the storage medium interface18.

The support program7stored in the storage medium18ais read by the computer system1via the storage medium interface18, and is stored in the HDD device14. When the computer system1has a wired or wireless communication interface, the support program7may be stored in the HDD device14via a communication medium.

The operation of the computer system1installed with the programming support program7will be described below using the flowcharts ofFIGS. 3 to 12.

When the programming support program7is launched on the computer system1, the CPU11starts a main process inFIG. 3.

The CPU11displays a thread generation dialog box on the display device17ausing a GUI (Graphical User Interface) in ST (step)1.

FIG. 13shows an example of the thread generation dialog box. On a thread generation dialog box30, a method area31, thread type area32, thread pool area33, queue area34, exclusive table area35, and thread parallel run count area36are formed. Also, an OK button37and cancel button38are provided.

On the method area31, a method name field31aas an identification name of each source file3, a class name field31b, and a source file name field31care formed. The method name field31adisplays a method name as the identification name of each source file3. On the method area31, an operator (programmer) can input a desired method name from the keyboard15aby designating the method name field31aby the pointer. Also, the operator (programmer) can input a desired class name from the keyboard15aby designating the class name field31bby the pointer.

On the thread type area32, selectors32a,32b, and32cof three different thread types (“Dynamic”, “Residence”, and “Singleton”) are formed. Each of the selectors32a,32b, and32cis operated to designate the thread type of the source file whose file name is displayed in the source file name field31c. The thread type classifies various threads by their operation differences upon execution.

A thread which belongs to a thread type “Dynamic” is a nonresident thread. This thread is dynamically generated in response to a process request message, and executes a process.

A thread which belongs to a thread type “Residence” is a resident thread. This thread is mapped to a memory upon launching a process, and controls to execute a job logic part in response to a process request message.

A thread which belongs to a thread type “Singleton” is a resident thread. This thread controls to continuously execute a resident thread of a single instance.

On the thread pool area33, selectors33aand33bused to select whether or not a thread pool is used are formed. The thread pool is selectable for a thread of thread type “Dynamic”. A thread of thread type “Residence” inevitably uses the thread pool. A thread of thread type “Singleton” does not use the thread pool.

On the queue area34, selectors34aand34bused to select whether or not message queuing is used, a queue name field34c, and a button34dused to instruct generation of a queue are formed. Message queuing is a method of storing busy received messages (process requests) in a buffer called a queue and executing them in turn. Message queuing is selectable for a thread of both thread type “Dynamic” and “Residence”. A thread of thread type “Singleton” does not use message queuing. The queue name field34cdisplays queue names as a pull-down menu.

On the exclusive table area35, selectors35aand35bused to select whether or not exclusive control is made, a table name field35c, and a button35dused to instruct generation of an exclusive table are formed. Exclusive control is selectable for a thread of both thread type “Dynamic” and “Residence”. A thread of thread type “Singleton” does not make exclusive control. The table name field35cdisplays the names of exclusive tables as a pull-down menu. An exclusive table is assured in the RAM13to register the names of threads that make exclusive control.

On the thread parallel run count area36, selectors36aand36bused to select whether or not the parallel run count is limited, and a parallel run count field36care formed. The parallel run count is the maximum number of threads that can run in parallel. The parallel run count is selectable for a thread of both thread type “Dynamic” and “Residence”. The parallel run count of a thread of thread type “Singleton” is fixed to “1”. The parallel run count field36cdisplays a parallel run count.

The CPU11prompts the operator (programmer) to set the method name and thread type by displaying the thread generation dialog box30. Also, the CPU11prompts the operator (programmer) to set the thread execution conditions such as the thread pool, message queuing, exclusive control, parallel run count, and the like by displaying the thread generation dialog box30.

After the thread generation dialog box30is displayed, the CPU11checks in ST2if text data is input to the method name field31aor class name field31bon the method area31. If no text data is input, the CPU11advances to a process of ST3.

If text data is input, the CPU11executes a method input process. This process will be described in detail below using the flowchart ofFIG. 4.

The CPU11determines in ST21whether the text data is input to the method name field31aor class name field31b.

If the text data is input to the method name field31a, the CPU11stores that text data in the RAM13as a method name in ST22. The CPU11automatically generates a class name and source file name on the basis of the method name in ST23. The CPU11stores the class name and source file name in the RAM13.

The CPU11displays the class name and source file name in the class name field31band source file name field31cin the method area31in ST24. The CPU11sets a method name input flag to “1” in ST25. The input flag is stored in the RAM13.

If the text data is input to the class name field31b, the CPU11checks in ST26if the input flag is “1”. If the input flag is not “1”, the CPU11determines an error since the class name is input prior to a method name.

If the input flag is “1”, the CPU11rewrites the class name stored in the RAM13by the text data input to the class name field31bin ST27.

Upon completion of the method input process, the CPU11advances to the process of ST3.

The CPU11checks in ST3if one of the selectors32a,32b, and32con the thread type area32is selected. If none of these selectors is selected, the CPU11advances to a process of ST4.

If one of the selectors32a,32b, and32cis selected, the CPU11executes a thread type select process. This process will be described in detail below using the flowchart ofFIG. 5.

The RAM13stores “DYNAMIC” as default data of thread type identification data.

The CPU11determines a thread type corresponding to the selected one of the selectors32a,32b, and32cin ST31. If the selector32acorresponding to thread type “Dynamic” is selected, the CPU11rewrites the thread type identification data stored in the RAM13to “DYNAMIC”. If the selector32bcorresponding to thread type “Residence” is selected, the CPU11rewrites the thread type identification data in the RAM13to “RESIDENCE”. If the selector32ccorresponding to thread type “Singleton” is selected, the CPU11rewrites the thread type identification data in the RAM13to “SINGLETON”.

Note that thread type identification data “DYNAMIC” is used as default data. However, data “RESIDENCE” or “SINGLETON” may be used instead.

Upon completion of the thread type select process, the CPU11advances to the process of ST4.

The CPU11checks in ST4if one of the selectors33aand33bon the thread pool area33is selected. If the selector33acorresponding to “not use thread pool” is selected, the CPU11sets a thread pool flag SPF to “0”. If the selector33bcorresponding to “use thread pool” is selected, the CPU11sets the thread pool flag SPF to “1”. The thread pool flag SPF is stored in the RAM13.

The selectors33aand33bare selectable when thread type “Dynamic” or “Residence” is selected. When thread type “Singleton” is selected, the selectors33aand33bcannot be selected. The thread pool flag SPF is automatically set to “1” when thread type “Singleton” is selected.

The CPU11checks the presence/absence of input to the queue area34in ST5. If no input is detected, the CPU11advances to a process of ST6.

If the selector34acorresponding to “not use message queuing” is selected, the CPU11sets a queue flag QUF to “0”. The queue flag QUF is stored in the RAM13. After that, the CPU11advances to the process of ST6.

If the queue generation button34dis input, the CPU11executes a queue generation process. This process will be described in detail below using the flow chart ofFIG. 6.

The CPU11displays a queue generation dialog box on the display device17ausing the GUI in ST51.

FIG. 14shows an example of the queue generation dialog box. On a queue generation dialog box40, a queue name field41, queue size field42, priority field43, and save flag area44are formed. Also, an OK button45and cancel button46are provided. On the save flag area44, selectors44aand44bused to select whether or not a save flag is saved are formed.

The CPU11prompts the operator (programmer) to set the queue name, queue size, priority, and save flag by displaying the queue generation dialog box40.

The queue size indicates the number of messages [1 to 99999] that can be stored in the queue. The priority is that of the queue, and is set in 10 levels. Priority=1 is the top priority. Lower-priority queues are not executed until all higher-priority queues are processed. If the save flag is set to “save”, an unprocessed queue is saved in a file upon completion of a process. The saved queue is read out from the file and is processed upon launching of the process next time.

If text data is input to the queue name field41in ST52, the CPU11stores that text data in the RAM13as a queue name.

If numerical value data is input to the queue size field42within the range from 1 to 99999 in ST53, the CPU11stores that numerical value data in the RAM13as a queue size.

If numerical value data is input to the priority field43within the range from 1 to 10 in ST54, the CPU11stores that numerical value data in the RAM13as a priority level.

If one of the selectors44aand44bon the save flag area44is selected in step S55, the CPU11determines the selector that has been selected. If the selector44acorresponding to “not save save flag” is selected, the CPU11sets a queue save flag QPF to “0”. If the selector44bcorresponding to “save save flag” is input, the CPU11sets the queue save flag QPF to “1”.

If the OK button45is input in ST56, the CPU11controls the screen display on the display device17ato go back to the thread generation dialog box30. Then, the CPU11displays the queue name stored in the RAM13on the queue name field34con the thread generation dialog box30. After that, the CPU11sets the queue flag QUF to “1”, and advances to the process of ST6.

If the cancel button46is input in ST57, the CPU11controls the screen display on the display device17ato go back to the thread generation dialog box30. The CPU11clears data (queue name, queue size, priority, save flag) which are stored in the RAM13and associated with message queuing. The CPU11sets the queue flag QUF to “0” if it is “1”, and advances to the process of ST6.

The CPU11checks the presence/absence of input to the exclusive table area35in ST6. If no input is detected, the CPU11advances to a process of ST7.

If the selector35acorresponding to “not use exclusive table (not make exclusive control)” is selected, the CPU11sets an exclusive table flag EXF to “0”. The exclusive table flag EXF is stored in the RAM13. After that, the CPU11advances to the process of ST7.

If the exclusive table generation button35dis input, the CPU11executes an exclusive table generation process. This process will be described in detail below using the flowchart ofFIG. 7.

The CPU11displays an exclusive table generation dialog box on the display device17ausing the GUI in ST61.

FIG. 15shows an example of the exclusive table generation dialog box. On an exclusive table generation dialog box50, a table name field51, a method name list field52of a target thread, a method name list field53of an exclusive thread, and a new method name field54are formed. Also, an add button55and delete button56of an exclusive thread, an all add button57, an all delete button58, an add button59of a new method name, an OK button60, and a cancel button61are laid out.

The CPU11prompts the operator (programmer) to select a thread which is to undergo exclusive control by displaying the exclusive table generation dialog box50.

The CPU11checks in ST62if an exclusive table is stored in the RAM13. If no exclusive table is stored, the CPU11waits for input of an exclusive table name in ST63. If the cancel button61is input in ST64, the CPU11controls the screen display of the display device17ato go back to the thread generation dialog box30, and advances to the process of ST7.

If a table name of an exclusive table is input to the table name field51, the CPU11generates an exclusive table with that table name in the RAM13in ST65. The CPU11displays all method names stored in the RAM13in the method name list field52in ST66. At this time, since the exclusive table does not store any method name of the thread which is to undergo exclusive control, nothing is displayed in the method name list field53.

If the exclusive table has already been stored in the RAM13in ST62, the CPU11jumps to a process of ST66.

The CPU11displays method names stored in the exclusive table in the method name list field53, and the remaining method names stored in the RAM13in the method name list field52in ST66.

Upon completion of the process of ST66, the CPU11waits for input of one of the buttons55to61.

If the add button59of a new method name is input in ST67, the CPU11stores a method name input to the new method name field54in the RAM13. After the method name is stored, the CPU11updates the display contents on the method name list fields52and53. The CPU11then waits for input of one of the buttons55to61again.

If the exclusive thread add button55is input in ST68, the CPU11copies a selected one of method names displayed in the method name list field52to the exclusive table on the RAM13. After the method name is copied to the exclusive table, the CPU11updates the display contents in the method name list fields52and53. The CPU11then waits for input of one of the buttons55to61again.

If the exclusive thread delete button56is input in ST69, the CPU11deletes a selected one of the method names displayed in the method name list field53from the exclusive table. After the method name is deleted from the exclusive table, the CPU11updates the display contents in the method name list fields52and53. The CPU11then waits for input of one of the buttons55to61again.

If the all add button57is input in ST70, the CPU11copies all the method names displayed in the method name list field52to the exclusive table in the RAM13. After all the method names are copied to the exclusive table, the CPU11updates the display contents in the method name list fields52and53. The CPU11then waits for input of one of the buttons55to61again.

If the all delete button58is input in ST71, the CPU11deletes all the method names displayed in the method name list field53from the exclusive table. After all the method names are deleted from the exclusive table, the CPU11updates the display contents in the method name list fields52and53. The CPU11then waits for input of one of the buttons55to61again.

If the OK button60is input in ST72, the CPU11controls the screen display on the display device17ato go back to the thread generation dialog box30. The CPU11displays the exclusive table name stored in the RAM13in the table name field35cin the thread generation dialog box30. The CPU11sets the exclusive flag table EXF to “1”, and advances to the process of ST7.

If the cancel button61is input in ST73, the CPU11controls the screen display on the display device17ato go back to the thread generation dialog box30. The CPU11deletes the exclusive table stored in the RAM13. The CPU11sets the exclusive flag table EXF to “0” if it is “1”, and advances to the process of ST7.

The CPU11checks the presence/absence of input to the parallel run count area36in ST7. If no input is detected, the CPU11advances to a process of ST8.

If the selector36acorresponding to “not limit parallel run count” is selected, the CPU11sets a parallel run count flag PRF to “0”. The parallel run count flag PRF is stored in the RAM13. After that, the CPU11advances to the process of ST8.

If the selector36bcorresponding to “limit parallel run count” is selected, the CPU11executes a parallel run count limit process. This process will be described in detail below using the flowchart ofFIG. 7.

The CPU11waits for input of a numerical value not less than 0 to the parallel run count field36cin the parallel run count area36in ST81. If a numerical value is input, the CPU11checks in ST82if the input numerical value is “0”.

If a numerical value larger than “0” is input, the CPU11stores this numerical value in the RAM13as a parallel run count, and displays that numerical value in the parallel run count field36c. The CPU11sets the parallel run count flag PRF to “1”, and advances to the process of ST8.

If “0” is input, the CPU11checks the parallel run count flag PRF. If the parallel run count flag PRF is “1”, the CPU11sets the parallel run count flag PRF to “0”, and advances to the process of ST8.

The CPU11checks in ST8if the OK button37in the thread generation dialog box30is input. If the OK button37is not input, the CPU11checks in ST9if the cancel button38is input. If the cancel button38is not input either, the CPU11returns to the process of ST2.

If the OK button37is input, the CPU11executes a thread definition storage process. This process will be described in detail below using the flowchart ofFIG. 9.

The CPU11checks in ST91if a method name is input to the method name field31ain the method area31. If no method name is input (no method name is stored in the RAM13), the CPU11advances to a process of ST10.

If a method name is input (a method name is stored in the RAM13), the CPU11sets that method name and a corresponding class name in first and second parameters of a thread definition record (ON_JOB).FIG. 16shows the format of the thread definition record (ON_JOB).

The CPU11checks a thread type selected by one of the selectors32a,32b, and32cfrom the three different thread types in ST92.

If thread type “Singleton” is selected (thread type identification data “SINGLETON” is stored in the RAM13), the CPU11executes the following process.

The CPU11sets thread type identification data “SINGLETON”, parallel run count [1], and data “null” in third, fourth, and fifth parameters of the thread definition record (ON_JOB), respectively. Data “null” indicates that none of the exclusive table, message queuing, and thread pool are used.

In this manner, since the thread definition record (ON_JOB) is settled, the CPU11reflects the thread definition record (ON_JOB) in the definition file4of the source program2in ST97. After that, the CPU11advances to the process of ST10.

If thread type “Residence” is selected (thread type identification data “RESIDENCE” is stored in the RAM13), the CPU11executes the following process.

The CPU11sets thread type identification data “RESIDENCE” and data “UseMsThreadPool” in third and seventh parameters of the thread definition record (ON_JOB), respectively. Data “UseMsThreadPool” indicates that the thread pool is used.

The CPU11checks the parallel run count flag PRF in ST94. If the parallel run count flag PRF is “0”, the CPU11sets parallel run count [0] in a fourth parameter of the thread definition record (ON_JOB).

If the parallel run count flag PRF is “1”, the CPU11sets the parallel run count stored in the RAM13in the fourth parameter of the thread definition record (ON_JOB).

The CPU11checks the exclusive table flag EXF in ST95. If the exclusive table flag EXF is “0”, the CPU11sets data “null” in a fifth parameter of the thread definition record (ON_JOB). Data “null” indicates that no exclusive control is made.

If the exclusive table flag EXF is “1”, the CPU11sets the exclusive table name stored in the RAM13in the fifth parameter of the thread definition record (ON_JOB).

The CPU11executes an exclusive table definition storage process. The exclusive table definition storage process will be described later.

The CPU11checks the queue flag QUF in ST96. If the queue flag QUF is “0”, the CPU11omits a sixth parameter of the thread definition record (ON_JOB). At this time data “UseMsThreadPool” inserted in the seventh parameter is shifted to the sixth parameter.

If the queue flag QUF is “1”, the CPU11sets the queue name stored in the RAM13in the sixth parameter of the thread definition record (ON_JOB).

The CPU11executes a queue definition storage process. The queue definition storage process will be described later.

The CPU11reflects the thread definition record (ON_JOB) in the definition file4of the source program2in ST97. After that, the CPU11advances to the process of ST10.

If thread type “Dynamic” is selected (thread type identification data “DYNAMIC” is stored in the RAM13), the CPU11executes the following process.

The CPU11sets thread type identification data “DYNAMIC” in the third parameter of the thread definition record (ON_JOB).

The CPU11checks the thread pool flag SPF in ST93. If the thread pool flag SPF is “0”, the CPU11omits the seventh parameter of the thread definition record (ON_JOB). If the thread pool flag SPF is “1”, the CPU11sets data “UseMsThreadPool” in the seventh parameter.

After that, the CPU11executes the processes of ST94to ST97in turn as in the case wherein thread type “Residence” is selected. In this way, since the thread definition record (ON_JOB) is settled, the CPU11reflects the thread definition record (ON_JOB) in the definition file4of the source program2. After that, the CPU11advances to the process of ST10.

The exclusive table storage process will be described below using the flowchart ofFIG. 10.

When the exclusive table storage process starts, the CPU11sets the exclusive table name stored in the RAM13in a first parameter of an exclusive table definition record (EXCLUSIVE_JOB).FIG. 16shows the format of the exclusive table definition record (EXCLUSIVE_JOB).

The CPU11checks if the exclusive table stored in the RAM13stores the method names of a thread which is to undergo exclusive control. If method names are stored, the CPU11sets all the stored method names in second and subsequent parameters of the exclusive table definition record (EXCLUSIVE_JOB) in turn.

If no method name is stored, the CPU11omits the second and subsequent parameters of the exclusive table definition record (EXCLUSIVE_JOB). In this way, since the exclusive table definition record (EXCLUSIVE_JOB) is settled, the CPU11reflects the exclusive table definition record (EXCLUSIVE_JOB) in the definition file4. After that, the CPU11advances to the process of ST96.

The queue definition storage process will be described below using the flowchart ofFIG. 11.

When the queue definition storage process starts, the CPU11sets the queue name, queue size, and priority stored in the RAM13in first to third parameters of a queue definition record (THREAD_QUE), respectively.FIG. 16shows the format of the queue definition record (THREAD_QUE).

The CPU11checks the queue save flag QPF. If the queue save flag QPF is “1”, the CPU11sets data “QueSaveFile” in a fourth parameter of the queue definition record (THREAD_QUE). Data “QueSaveFile” indicates that the save flag is saved.

If the queue save flag QPF is “0”, the CPU11omits the fourth parameter of the queue definition record (THREAD_QUE). In this way, since the queue definition record (THREAD_QUE) is settled, the CPU11reflects the queue definition record (THREAD_QUE) in the definition file4. After that, the CPU11advances to the process of ST97.

FIG. 17shows an example of the definition file4. InFIG. 17, the queue definition record (THREAD_QUE) is reflected in (inserted in) a line next to source code “protected override void QUEMAP”. The exclusive table definition record (EXCLUSIVE_JOB) is reflected in (inserted in) a line next to source code “protected override void EXCLUSIVEMAP”. The thread definition record (ON_JOB) is reflected in (inserted in) a line next to source code “protected override void JOBMAP”.

The CPU11executes a source file save process in ST10. This process will be described in detail below using the flowchart ofFIG. 12.

The CPU11checks in ST101if a method name is input to the method name field31ain the method area31. If no method name is input (no method name is stored in the RAM13), the CPU11advances to a process of ST11.

If a method name is input (a method name is stored in the RAM13), the CPU11checks a thread type selected by one of the selectors32a,32b, and32cfrom the three different thread types in ST102.

If thread type “Singleton” is selected (thread type identification data “SINGLETON” is stored in the RAM13), the CPU11reads out template data “SINGLETON” from the template file8. The CPU11reflects the method name and the like stored in the RAM13in the template data “SINGLETON”.

If thread type “Residence” is selected (thread type identification data “RESIDENCE” is stored in the RAM13), the CPU11reads out template data “RESIDENCE” from the template file8. The CPU11reflects the method name and the like stored in the RAM13in the template data “RESIDENCE”.

If thread type “Dynamic” is selected (thread type identification data “DYNAMIC” is stored in the RAM13), the CPU11reads out template data “DYNAMIC” from the template file8. The CPU11reflects the method name and the like stored in the RAM13in the template data “DYNAMIC”.

The template file8stores templates of source codes which are set in correspondence with thread types.FIG. 18shows an example of the template data “DYNAMIC”. A method name is reflected (inserted) on a portion of source code “FUNC_NAME” inFIG. 18.

The CPU11generates one source file3on the basis of the template data that reflects the method name and the like in ST103. The CPU11then saves this source file3in the source program. The CPU11clears data (thread name, class name, source file name, thread identification data, exclusive table, queue data, various flags, and the like) stored in the RAM13. After that, the CPU11advances to the process of ST11.

The CPU11quits the programming support program7in ST11.

When the programming support program7is launched on the computer system1, the thread generation dialog box30is displayed on the display device17a. The programmer determines the method name of a new source file3to be generated first. The programmer inputs that method name to the method name field31ain the method area31. Then, a class name and source file name are automatically generated based on this method name.

The programmer then determines the thread type of the source file3. The programmer clicks one of the selectors32a,32b, and32cin the thread type area32, which corresponds to the determined thread type.

If the determined thread type is “Dynamic”, the programmer determines whether or not a thread pool is used. If the thread pool is used, the programmer clicks the selector33bon the thread pool area33.

If the determined thread type is “Dynamic” or “Residence”, the programmer determines whether or not message queuing is used. If message queuing is used, the programmer clicks the queue generation button34don the queue area34. In response to this operation, the queue generation dialog box40is displayed on the display device17a. The programmer inputs a desired queue name, queue size, priority, and presence/absence of the save flag via the queue generation dialog box40.

If the determined thread type is “Dynamic” or “Residence”, the programmer determines whether or not exclusive control is made. If exclusive control is made, the programmer clicks the exclusive table generation button35din the exclusive table area35. In response to this operation, the exclusive table generation dialog box50is displayed on the display device17a. The programmer selects the method name of a thread which is to undergo exclusive control from the method name list field52, and inputs the exclusive thread add button55. Then, the method name of the thread which is to undergo exclusive control is added to the method name list field53.

If the determined thread type is “Dynamic” or “Residence”, the programmer determines whether or not the parallel run count is limited. If the parallel run count is limited, the programmer selects the selector36bin the parallel run count area36, and then inputs a parallel run count in the parallel run count field36c.

After that, the programmer inputs the OK button37on the thread generation dialog box30. In response to this operation, the thread definition record (ON_JOB) which includes parameters of the method name, class name, thread type identification data, parallel run count, exclusive table name, queue name, and thread pool management availability data is reflected in the definition file4.

When exclusive control is to be made, the exclusive table definition record (EXCLUSIVE_JOB) which includes parameters of the exclusive table name and the method names of exclusive threads is reflected in the definition file4.

When message queuing is used, the queue definition record (THREAD_QUE) which includes parameters of the queue name, queue size, priority, and save flag is reflected in the definition file4.

Subsequently, template data is read out from the template file8. If the determined thread type is “Dynamic”, template data “DYNAMIC” is read out. If the determined thread type is “Residence”, template data “RESIDENCE” is read out. If the determined thread type is “Singleton”, template data “SINGLETON” is read out.

After that, the thread name stored in the RAM13is reflected in the template data read out from the template file8, thus generating a source file3. This source file3is saved in the source program2.

In this manner, the programmer can generate a source file3for each thread and one definition file4by inputting only minimum required information via the GUI dialog boxes30,40, and50displayed on the display device17a. The source program2which consists of the source files3and definition file4is compiled by the predetermined compiler5, thus generating an object program6as a desired object.

Therefore, the programmer can program even when he or she does not understand the meaning and way to use each individual source code. Since no input errors of the source code occurs, even a beginner can easily program without any errors.

Note that this embodiment uses three selectable thread types “Dynamic”, “Residence”, and “Singleton”. However, the number of thread types is not limited to three.

In the above embodiment, the programming support program7is installed on the computer system1via the storage medium or communication medium. Also, the present invention includes a computer system dedicated to programming, which pre-stores the programming support program7.