Wait for service request in an iconic programming system

Abstract: Disclosed in an iconic programming system process for processing the icons within an iconic network. When a user starts execution of the iconic system, the system first separates the icons into a list of threads, and creates a pending queue and a done stack for each thread. Execution then starts by selecting the first icon in the pending queue of the first thread within the system, processing the icon, and placing the icon on the done stack. After all icons on the pending queue are processed, icons are removed from the done stack and a sequence signal is sent on the sequence output for the icon. If a service request is received, the subthread hosted by an active service request icon is immediately made the highest priority, and processing continues with this subthread until the subthread is completely processed.

Description: FIELD OF THE INVENTION This invention relates to computer systems and more particularly to Iconic Programming Systems. Even more particularly, the invention relates to determining the order of processing each icon in such a system. BACKGROUND OF THE INVENTION An iconic programming system is a "programming-less" environment where programming is done by connecting graphical images of tools (icons), together with connecting lines, to form a directed graph and create an iconic network which represents a software program. The iconic programming system may be used in research and development test environments, where several different electronic instruments are connected to test a system or device. Programming such a system requires instructions to cause the various instruments to perform desired functions in order to operate as a system. When an iconic programming system is used, each instrument will be represented by a graphical icon, also called a graphical object, and the connections between the instruments are represented by lines between the graphical images. In addition to graphical icons representing instruments in such a system, graphical icons are provided for programming functions, for example looping, IF-THEN statements, etc. By combining instrument and programming icons, a user can create an iconic network involving the programmed operation of several instruments. Iconic systems are designed to process without a particular order as to which icons process before other icons, except that an icon will not normally process until all data necessary for its processing is available. When all data is available to several icons, they may process simultaneously. In order to construct iconic systems that function with real world instruments, and which function on a single processor, the icons must process in some defined order. One definition of the order for processing icons is supplied by the conventional rules associated with data flow diagrams. An important limitation of such a system, however, is that the conventional rules of data flow diagrams do not provide for asynchronous operations such as interrupts or service requests. When an iconic system is used with a real-world device, for example when the computer that processes the iconic programming system is connected to an external device such as a signal generator or voltmeter, the connection is performed through some interface card (circuit) within the computer. One such interface is the IEEE 488 bus, also known as the Hewlett-Packard Interface Bus (HPIB). When one of these real-world devices detects a condition which requires service from the host computer, it initiates a service request (SRQ) event over the bus to signal the host computer. Since these conditions may occur only for a very short time, and often the device requiring service cannot perform other functions until it is serviced, the iconic programming system must provide a way of processing these service requests. Also, A service request may be cleared within a device by any access to the device. Therefore, the iconic programming system must ensure that no extraneous references are made to the device before the service request can be processed by the desired service request thread. Some prior art systems, for example multi-tasking operating systems, are designed to process interrupts, which is similar to processing a service request. In these systems, however, the interrupt service routine is typically only given a high priority, and other processing is continued if the interrupt service routine becomes idle. Thus, in such an idle period, the other processing in these systems could reference the device and possibly clear the service request before it is processed by the interrupt service routine. There is a need in the art then for a system that will provide a way for a programmer in an iconic system to process service requests. There is further need for such a system to suspend other processing and immediately process the service request. The present invention meets these needs. Various features and components of an iconic network system are disclosed in U.S. patent applications: (A) Application serial No. 07/483,478 filed 02/22/90 for PROGRAMMING ESCAPE FROM AN ICONIC SYSTEM of Bailey, Beethe, Wolber, and Williams; (B) Application serial No. 07/661,936 filed Feb. 28, 1991 for LINE PROBE IN AN ICONIC PROGRAMMING SYSTEM of Wolber; (C) Application serial No. 07/668,286 filed Mar. 12, 1991 for INPUT AND OUTPUT CONSTRAINTS ON DEVICES IN AN ICONIC PROGRAMMING SYSTEM of Wolber and Beethe; and (D) application serial No. 07/668,285 filed Mar. 12, 1991 for A SYSTEM FOR ENTERING AND MODIFYING VARIABLE NAMES FOR TERMINALS OF ICONS IN AN ICONIC PROGRAMMING SYSTEM of Wolber and Beethe; each of which is hereby specifically incorporated by reference for all that is disclosed therein. SUMMARY OF THE INVENTION The invention is defined in the appended claims. BRIEF DESCRIPTION OF THE DRAWINGS The above and other aspects, features, and advantages of the invention will be better understood by reading the following more particular description of the invention, presented in conjunction with the following drawings, wherein: Fig. 1 shows a block diagram of a computer system incorporating the present invention; Fig. 2 shows an iconic network for testing an audio filter; Fig. 3 shows a flowchart of the pre-run process; Fig. 4 shows a flowchart of the run process; Fig. 5 shows a flowchart of the method of processing (firing) an icon; Fig. 6 shows an example of an iconic network; Fig. 7 shows an example of an iconic network forcing a particular order of processing; Fig. 8 shows an example of an iconic network having two threads; Fig. 9 shows an example of an iconic network having two iteration icons; Fig. 10 shows a diagram of an iconic network incorporating service request processing; and Fig. 11 shows an iconic network that illustrates determining the device requiring service. DESCRIPTION OF THE PREFERRED EMBODIMENT The following description is of the best presently contemplated mode of carrying out the present invention. This description is not to be taken in a limiting sense but is made merely for the purpose of describing the general principles of the invention. The scope of the invention should be determined by referencing the appended claims. Fig. 1 shows a block diagram of a computer system incorporating the present invention. Referring now to Fig. 1, a computer system 100 contains a processing element 102 which connects to the other components of the system through a system bus 104. A keyboard 106 allows a user to input textual data to the system, and a mouse 110 allows a user to input graphical data to the system. A graphics display 108 allows the system to output text and graphical information to the user. A disk 112 is used by the system to store the software of the iconic programming system environment, as well as the user-defined iconic network. An instrument bus 116, typically an IEEE 488 bus, is used to allow the iconic programming system to communicate with test instruments. Memory 114 is used to contain the software and user data of the iconic programming environment. A multi-tasking operating system 120 can have a plurality of tasks, also called processes, here illustrated by task 122 and task 124. Task 122 is shown containing the iconic programming process of the present invention. Fig. 2 shows an iconic network for testing an audio filter. Referring now to Fig. 2, iconic network 202, which is a directed graph, is comprised of a start icon 204 having its sequence output 205 connected to the sequence input 207 of an iteration icon 206. The sequence output 209 of the iteration icon 206 connects to an end icon 208. The data output 220 of the iteration icon 206 connects to the data input 226 of a frequency generator 210. The data output 220 also connects to the X input 222 of an X-Y display 216. A sequence output 232 of the frequency generator icon 210 connects to a sequence input 234 of a digital voltmeter 212. The digital voltmeter icon 212 has a data input 230 coming from the data output 228 of a range selector switch 214. The data output 223 of the digital voltmeter is connected to the Y input 224 of the X-Y display 216. The FGEN icon 210 represents a real external sweep frequency generator which is connected to the input of the audio filter being tested (not shown). The digital voltmeter icon 212 represents an external real digital voltmeter connected to the output of the audio filter being tested. The iconic programming system controls these real devices over the instrument bus 116. When the start icon 204 is activated, it will send a sequence signal to the iteration icon 206 which will start through an iteration loop. During the first iteration, the iteration icon 206 will send a data value of one hundred over the data output 220 to the frequency generator 210. This will cause the real frequency generator that is connected to the audio filter to output a frequency of one hundred hertz. After the frequency generator has output the one hundred hertz signal, it will inform the FGEN icon 210 that the signal has been output and the FGEN icon 210 will send a sequence signal over the sequence output 232 to the sequence input of the digital voltmeter icon 212. The digital voltmeter icon 212 will obtain a range setting from the range switch 214 and send a signal to the external digital voltmeter to cause it to read the output of the audio filter being tested. The output read from the external digital voltmeter, via the instrument bus 116, will be sent over the data output 223 to the Y input 224 of the X-Y display. The X-Y display, since it has received an X input of one hundred hertz on data input 222 and a Y input on 224 consisting of the digital voltmeter reading, will plot one point on the X-Y display. After this first iteration is complete, the iteration icon 206 will step the frequency by one hundred hertz and output a frequency of two hundred hertz on data output 220. The steps described above will operate in the same sequence, and a second plot point will be plotted on the X-Y display 216. This will continue until the iteration icon 206 has reached a frequency of ten thousand hertz. At that point, the number of points being plotted will result in the graph 218 on the X-Y display. The iteration icon 206 will then send a sequence signal to end icon 208 and processing will terminate. Table 1 shows the icon device rules that all icons on graphical network must obey. Table 2 shows the rules involved in processing the icons on a particular thread within a graphical network. These rules will be better illustrated in the following flowcharts which describe the process of analyzing and executing the icons on a graphical network. Fig. 3 shows a flowchart of the pre-run process of the present invention. This flowchart will be called whenever a user enters a run command, or uses the graphical input device 110 (Fig. 1) to "push" a start icon on a graphical network. Referring now to Fig. 3, after entry, block 302 determines whether all input pins of all icons have been connected, in order to satisfy Icon Device Rule 1 (Table 1). If any input is unconnected, block 302 transfers to block 316 which displays an error message and returns. If all input pins are connected, block 302 transfers to block 304 which determines whether any inputs have multiple connections, in order to determine whether rule 2 of the Icon Device Rules (Table 1) has been satisfied. If any input has multiple connections, block 304 transfers to block 316 which displays an error message before returning. If no input pin has more than one connection, block 304 transfers to block 306 which determines whether any start icons are present in the graphical network. If any start icons are present, block 306 transfers to block 308 which schedules the start icons by placing them in the pending queue of their respective threads in order to satisfy the part of Thread Rule 6 (Table 2) that states that all starts must fire (process) before any other devices on the thread. If no start icons are present, block 306 transfers to block 310 which checks to determine if any feedback inputs exist for any icons. Since block 306 already determined that no start icons were present, if any feedback inputs exist, block 310 will transfer to block 316 to display an error message, in order to satisfy Thread Rule 5 ( Table 2). If no feedback inputs are present, block 310 transfers to block 312. Since no start icon was found on the graph, and no feedback loops were found on the graph, block 312 will place all the icons on the graph on the start queue at the same time, in order to satisfy Thread Rule 7 (Table 2). Block 312 then transfers to block 314 which calls Fig. 4 to process the icons within the graph. Fig. 4 will return after the graphical network has been completely processed, and block 314 will then return to the caller. Fig. 4 shows a flowchart of the run process. This process is called by Fig. 3 after Fig. 3 has determined that the graph is capable of being processed. Referring now to Fig. 4, after entry, block 401 will initialize the threads and reset all the processed flags, indicating that the icons have not yet fired. Block 420 will determine if a service request is active, and if one is active, block 420 will transfer to block 422. Block 422 finds a thread with an active wait for SRQ icon and makes this thread highest priority by selecting the thread and transferring directly to block 404. If no service request is pending, block 420 transfers to block 402 which will point to the first (or next) thread within the graphical network. Each thread on the graphical network has its own pending queue and its own done stack, and these two data structures determine which icon will be processed next within a graph. In order to satisfy Thread Rule 8, if more than one thread exists on a graphical network, the threads will be processed in a round-robin style, with one icon being processed on each thread with each cycle. After pointing to the first, or next thread, block 402 transfers to block 404 which determines whether the pending queue for that thread is empty. If the pending queue is not empty, block 404 transfers to block 406 which gets the first icon from the pending queue for the thread. Block 408 then calls Fig. 5 to process (fire) the icon just retrieved from the pending queue. After that icon has been processed, Fig. 5 returns to block 420 and if no service request is pending control goes to block 402 which points to the next thread. If the pending queue for a particular thread is empty, block 404 will transfer to block 410 which determines whether the done stack for that thread is empty. If the done stack is not empty, block 410 transfers to block 412 which pops the top icon from the done stack and then block 414 determines whether the icon has a sequence output. If the icon has no sequence output, block 414 returns to block 410 which checks the stack again. If the icon does have a sequence output, block 414 transfers to block 415 which sends a sequence signal to all icons connected to the sequence output and then block 416 takes each of the icons connected to the sequence output and places them on the pending queue for the thread. This block satisfies Device Rule 5 (Table 1) by firing the sequence output of all icons after propagation has continued along the standard output lines as far as possible. If block 410 determines that the done stack for a particular thread is empty, it transfers to block 418 which checks to see if all threads have been completely processed. If any thread remains to be processed, block 418 returns to block 420 to continue processing that thread. After all threads are complete, block 418 returns to Fig. 3. Fig. 5 shows a flowchart of the method of processing (firing) an icon. Referring now to Fig. 5, after entry, block 501 checks the processed flag and if it is set, control goes to block 518, since an icon will only process once. If the processed flag is not set, block 501 transfers to block 502 which determines whether the sequence input to the icon is connected. If the sequence input is connected, Device Rule 4 (Table 1) states that the device can process (execute) only if a signal has been received on the sequence input. Therefore, if a sequence input is connected, block 502 transfers to block 504 to determine whether a signal has been received on the sequence input. If a signal has not been received on the sequence input, this icon cannot be processed, so block 504 transfers to block 508 which puts the icon not supplying the sequence signal on the pending-queue and then transfers to block 518 which removes the icon from the pending queue before returning to Fig. 4. If a sequence signal has been received, block 504 transfers to block 506. If the sequence input is not connected, block 502 transfers to block 506 which determines whether data has been received on all input data pins, in order to determine whether Device Rule 3 has been satisfied. If data has not been received on one or more input pins, block 506 transfers to block 508. Block 508 will attempt to "pull" icons that have not yet supplied data, in order to satisfy Thread Rule 3. This pulling is accomplished by placing all icons that have not supplied data to this icon into the pending queue for the thread. Block 508 then transfers to block 518 which removes the icon from the pending queue. This icon will reappear on the pending queue after the icons being "pulled" have been processed. If data has been received on all input pins, block 506 will transfer to block 510 which performs the functions of the icon. Also, if a signal has been received on the sequence input, block 504 will transfer to block 510. If the icon is an iteration icon, block 510 will create a virtual subthread for all icons connected to the data output of the iteration icon. The thread containing (hosting) the iteration icon will be blocked from processing and the virtual subthread will be initialized by resetting the processed flags of all icons in the virtual subthread. The virtual subthread will then be processed to completion, and the iteration thread (host thread) will be unblocked. If the icon is one that performs a subprogram, the thread containing the subprogram (calling) icon will be blocked from processing and the subthread will be initialized by resetting the processed flags of all the icons in the subthread. The subthread will then be processed to completion, and the subprogram (calling) thread will be unblocked. After performing the functions, block 510 will set the processed flag for the icon, so that it will not process a second time, and transfer to block 512. Block 512 sends output data generated by processing the functions of the icon to all icons connected to the data output pins. Block 514 then schedules all the icons connected to the data outputs by placing the icons on the pending queue for the thread, if they are not already on the queue, and if they are not on the done stack. If an icon has multiple output pins, the icons connected to the top pin will be placed on the queue first, then the next pin down, etc. The order for placing icons connected to the same pin is undefined, and they may be placed on the queue in any order. Block 516 then places this icon on the done stack, and block 518 removes this icon from the pending queue, before returning to Fig. 4. Fig. 6 shows an example of an iconic network. Fig. 6 will be used to illustrate the flow through the flowcharts of Figs. 3, 4, and 5, and to further illustrate the Icon Device Rules of Table 1 and the Thread Rules of Table 2. Referring now to Fig. 6 as well as Figs. 3, 4, and 5, when a user uses the mouse 110 (Fig. 1) to "push" the start icon 602, Fig. 3 is called to perform the pre-run process on the graphical network of Fig. 6. Block 302 determines that all input pins are connected and block 304 determines that no pins have multiple connections. Block 306 finds the start icon 602, so block 308 puts the start icon 602 onto the pending queue. Block 314 then calls Fig. 4 to process the graphical network of Fig. 6. Block 402 points to the pending queue and done stack for the thread of Fig. 6, which is the only thread contained in the graphical network. Block 404 then determines that the pending queue is not empty, so block 406 gets the start icon 602 from the pending queue, and block 408 calls Fig. 5 to process the start icon. Block 502 determines that there is no sequence input to the start icon and block 506 determines that there are no data input pins connected, which is the same as having data available on all input pins. Therefore, block 510 performs the function of the start, which is a no-op, and block 512 and 514 perform no functions since there is no data output from the start icon. Block 516 pushes the start icon onto the done stack, and block 518 removes the start icon from the pending queue. Control then returns to block 420 and then to block 402 which points to the same thread. Block 404 determines that the pending queue is empty, so control transfers to block 410 which determines that the done stack is not empty, so block 412 pops the start icon from the done stack. Block 414 determines that the start block does have a sequence output, indicated by the arrowhead connection 603, so block 415 sends a sequence signal to the sequence input of icon A 604 and block 416 puts icon A 604 onto the pending queue. Control then returns to block 420 to process icon A 604. At this point, the pending queue has icon A 604 as its only entry, and the done stack is empty. Service requests are not involved so control goes to block 402 which points to the same thread, and block 404 determines that the pending queue is not empty, so block 406 gets the A icon 604 from the pending queue and block 408 calls Fig. 5 to process this icon. Block 502 determines that the A icon does have a sequence input connected, and block 504 determines that the sequence input has received a signal, since a signal was supplied when the start icon was popped from the done stack. Control transfers to block 510 which performs whatever function the A icon represents, and block 512 sends data output to the B icon 606, D icon 610, and to the C icon 608. Block 514 then puts the B icon 606, C icon 608 and D icon 610 onto the pending queue. Note that under Thread Rule 2 (Table 2) the order of placing the B, C, and D icons on the pending queue is undefined, since these icons are connected in parallel. Therefore, the above described order is coincidental. Block 516 then pushes the A icon onto the done stack, and block 518 removes the A icon 604 from the pending queue. Control then returns to block 420. At this point, the pending queue contains icons B 606, C 608, and D 610, and the done stack contains icon A 604. Block 402 then points to the same thread, and block 404 determines that the pending queue is not empty, so block 406 retrieves the next element from the pending queue, which is the B icon 606. Block 408 then calls Fig. 5 which processes the B icon by sending data to the E icon 612, placing the E icon 612 on the pending queue, placing the B icon 606 on the done stack, and deleting the B icon 606 from the pending queue. Control then returns to block 420. At this point, the pending queue has icon C 608, icon D 610, and icon E 612. The done stack has icon A 604 and icon B 606. The pending queue is not empty, so block 406 pulls the C icon 608 from the pending queue and block 408 calls Fig. 5 to process the C icon 608. Fig. 5 processes the C icon 608 by sending data to the D icon 610. Block 514 of Fig. 5 does not, however, place icon D on the pending queue, because icon D is already present on the pending queue. The C icon 608 is placed on the done stack and deleted from the pending queue and control returns to block 420. At this point, the pending queue has the D icon 610 and the E icon 612. The done stack has the A icon 604, B icon 606, and the C icon 608. Again, block 402 points to this thread, block 404 determines that the queue is not empty, block 406 pulls the D icon 610 from the pending queue, and block 408 calls Fig. 5 to process the D icon 610. Block 502 determines that the D icon does have a sequence input connected, so it transfers to block 504. Block 504 determines that the sequence input of the D icon 610 has not yet received a signal, so control transfers to block 508 which puts the B icon on the pending queue before transferring to block 518 which removes the D icon from the pending queue. Control then returns to block 420. Block 402 points to the current thread and block 404 determines that the pending queue is not empty, so block 406 pulls the E icon from the pending queue and block 408 calls Fig. 5 to process the E icon 612. Block 502 determines that the E icon 612 does not have a sequence input, so control transfers to block 506 which determines that data is not available on all input pins for the E icon 612. The B icon 606 has already fired, but the D icon 610 has not yet fired, so the E icon 612 does not yet have all of its data. Therefore, block 506 transfers to block 508 which puts the D icon 610 onto the pending queue because the D icon has not yet supplied data to the E icon. Control goes to block 518 which removes icon E from the pending queue and control returns to block 420. Block 402 points to the current thread and block 404 determines that the pending queue is not empty, so block 406 pulls the B icon from the pending queue and block 408 calls Fig. 5 to process the B icon. Block 502 determines that the B icon 606 has already been processed, so block 501 transfers to block 518 which simply removes the B icon from the pending queue. At this point, the pending queue has the D icon 610 as its only element, and the done stack has the A icon 604, B icon 606, and C icon 608. Block 402 points to this thread and block 404 determines that the queue is not empty, so block 406 pulls the D icon from the pending queue, and block 408 calls Fig. 5 to process the D icon again. Processing is the same as described above for the D icon, and because it does not have a signal on its sequence input it does nothing and is simply removed from the pending queue before control returns to block 420. At this point, the pending queue is empty and the done stack has the icons A 604, B 606, and C 608. Block 402 points to the current thread and block 404 determines that the pending queue is empty, so control transfers to block 410 which finds that the done stack is not empty, so block 412 pops the C icon 608 from the done stack, and block 414 determines that the C icon 608 does not have a sequence output, so control goes back to block 410 and on to block 412. Block 412 then pops the B icon 606 from the done stack, and block 414 determines that the B icon 606 does have a sequence output, arrowhead connection 620, so block 415 sends a sequence signal over arrowhead connection 620 to the D icon 610 and block 416 places the D icon onto the pending queue before control returns to block 420. At this point, the pending queue contains the D icon 610, and the done stack contains the A icon 604. Block 402 points to the same thread and block 404 finds that the pending queue is not empty, so block 406 pulls the D icon 610 from the pending queue, and block 408 calls Fig. 5 to process the D icon 610. Block 502 finds that the D icon 610 does have a sequence input connected, and transfers to block 504 which finds that the sequence input has received a signal, because of the process of popping B from the done stack, as described above. Therefore, control transfers to block 510 which performs the functions of the D icon and block 512 sends data output to the E icon. Block 514 then places the E icon onto the pending queue, block 516 places the D icon on the done stack, and block 518 deletes the D icon from the pending queue before returning control to block 420. Block 402 points to the same thread, and block 404 finds the pending queue is not empty, so block 406 gets the E icon from the pending queue and block 408 calls Fig. 5 to process the E icon. Fig. 5 finds that the E icon has data available on all of its input pins, so its functions are performed, and it is placed on the done stack, and deleted from the pending queue before returning to block 420. Block 402 points to this thread and block 404 determines that the pending queue is empty, so control transfers to block 410 which finds that the done stack is not empty. Block 412 then pops the E icon 612 from the done stack, and block 414 determines that the E icon 612 does not have a sequence output so control transfers to block 410. Block 410 finds that the done stack is still not empty, so block 412 pops the D icon 610 from the done stack, and block 414 finds that D icon 610 has no sequence output, so block 414 transfers back to block 410. Again, block 410 finds that the done stack is not empty, so block 412 now pops the A icon 604 from the done stack and block 414 finds that the A icon 604 has no sequence output, so block 414 transfers back to block 410. Block 410 now finds that the done stack is empty, so control transfers to block 418 which determines that the only thread of Fig. 6 is now complete, and returns to Fig. 3 which also returns to its caller. Fig. 7 shows another example of an iconic network. The example of Fig. 7 shows a specific sequence for processing some of the icons. Referring now to Fig. 7, after the user "pushes" the start icon 702, it will fire sending a sequence signal to the A icon 704. The A icon 704 will fire, sending data to the B icon 706, C icon 708, and D icon 710. This processing will be done in the manner described earlier with reference to Figs. 3, 4, and 5. The arrowhead sequence connection 720 between B icon 706 and C icon 708 requires that the B icon 706 processes before the C icon 708. If the sequence connection 720 was absent, this order of processing would be indeterminate. Likewise, the sequence connection 722 between C icon 708 and D icon 710 forces the C icon 708 to be processed before the D icon 710. After the B icon 706, C icon 708, and D icon 710 have all processed, the E icon 712 can then process. The diagram of Fig. 8 shows an iconic network having two threads. Referring now to Fig. 8, a thread 802 is comprised of a start icon 805, icon A1 806, icon B1 808, and icon C1 810. Another thread 804 is comprised of a start icon 812, icon A2 814, icon B2 816, icon C2 818, and icon D2 820. The invention will treat these two threads as a circular list, such that after processing one icon from thread 804, processing will continue with one icon from thread 802. The order in which these threads are processed is undetermined, and either thread may start processing first. For the following, it will be assumed that the thread 802 is the first to start processing. While processing the iconic network of Fig. 8, block 402 (Fig. 4) will satisfy Thread Rule 8 ( Table 2) by processing an icon from thread 802 and then pointing to thread 804. After an icon from thread 804 has been processed, block 402 will point back to the pending queue and done stack of thread 802 to process one icon from that thread. This alternating will continue until icon C1 810 has been processed. At this point, thread 802 will be completely processed, and block 402 will continue to point to thread 804 until it has completed its processing, at which point processing will terminate. As shown in the example described above, with reference to Fig. 6, 7 and 8, an icon will "fire" only once when all of its input data and/or its sequence input has been satisfied. This rule must be altered, however, for iteration icons such a icon 306 of Fig. 2. When an iteration icon is encountered, all of the icons connected to its data outputs are copied into a "virtual subthread". For each iteration of the iteration icon, the thread containing the iteration icon will be blocked from processing to allow the virtual subthread to be processed in the manner described with respect to Figs. 3, 4, and 5. After the processing is completed for the virtual subthread, it will be deactivated. With the next iteration, the virtual subthread will be reactivated, processed, and deactivated. This will continue until all iterations of the iteration icon have been completed, at which time the sequence output of the iteration icon will be fired and the icons connected to the sequence output will be processed in the normal manner. When a subprogram icon is encountered, all of the icons below the subprogram icon are included in a subthread. The thread containing the subprogram (calling) icon will be blocked from processing to allow the subthread to be processed in the manner described with respect to Figs. 3, 4, and 5. After the processing is completed for the subthread, the thread containing the subprogram (calling) icon will be unblocked. Fig. 9 shows an iconic network having two iteration icons, and illustrates an exception to the rule requiring an icon to have new data available on all data inputs before firing. Referring now to Fig. 9, when the user activates the network, the start icon will fire a sequence signal to iteration icon 904. Iteration icon 904 will send data over connection 910 to icon 908 and also to the sequence input 914 of iteration icon 906. Because of the connections between the iteration icons, icon 906 will process all its iterations each time iteration 904 fires once. Therefore, icon 908 is on two virtual subthreads, one from icon 904 and one from icon 906. Under the rules described above, icon 908 would only fire once for each iteration of icon 904 and the first iteration of icon 906, because data would only be available when both icon 904 and icon 906 had just fired. Although icon 906 would fire several times for each iteration of icon 904, the data from connection 910 would have been used up with the first firing of icon 908 and it would not fire again until icon 904 had fired again. The system detects this condition and allows the data on connection 910 to be reused by icon 908, thus allowing icon 908 to fire every time icon 906 supplies data. For example, if icon 904 iterates five times, and icon 906 iterates four times (each time it receives a signal on its sequence input 914), icon 908 will fire twenty times. Fig. 10 shows a very simple iconic network that illustrates processing service requests. Referring now to Fig. 10, three threads are shown. The first thread contains an "until break" icon 1002 that will always fire. The output of this icon will cause the wait for SRQ icon 1004 to check for any services requests on the bus attached to the computer system. Icon 1004 will sleep until a service request is received at which time it will fire its output. The output of the wait for SRQ icon 1004 is connected to a counter icon 1006. The second thread contains a second until break icon 1008 that will always fire. This will cause a second counter icon 1010 to continuously count up. The third thread contains a third until break icon 1012 connected to a third counter 1014. When the iconic network is started, until break icon 1002 will fire causing wait for SRQ icon 1004 to start waiting for a service request. Since the iconic network is not suspended while waiting for the service request, icon 1008 will fire causing counter 1010 to count up by one value. Icon 1012 will also fire causing counter 1014 to also count up. This counting will continue until a service request is received. When a service request is received, the second and third threads will be suspended, and the wait for SRQ icon 1004 will fire. When icon 1004 fires, counter icon 1006 will fire and increment the counter value, thus processing the service request. In this simple example, a service request was received after the second and third threads had counted to values of 31 and 30 respectively. Fig. 11 illustrates a more complicated iconic network for processing services requests. Referring now to Fig. 11, Only a single thread is shown. As was shown above with respect to other figures, multiple threads could also be processed. An until break icon 1102 is used to reactivitate the service request thread after each service request is processed. The output of the until break icon 1102 is connected to the sequence input of a wait for SRQ icon 1104. After the until break icon fires, it will activitate the wait for SRQ icon 1104 which will do nothing until a service request is detected. When the service request is detected the wait for SRQ icon 1104 will fire and cause the spoll icon 1106 to fire. The spoll icon 1106 will poll a scope device on the instrument bus 116 and ask the scope to indicate whether it has requested service. If the device has requested service, it will set bit 7 in the data returned to the spoll icon 1106. The spoll icon 1106 will send the returned data to the if/then icon 1108 which evaluates the bits to determine the device has requested service. If bit 7 is set, if/then icon 1108 will send information to the counter icon 1110 which increments a counter. After incrementing the counter, icon 1110 sends information to activate the next icon 1112. The next icon 1112 causes the entire thread to reset and start with icon 1102. This is done to terminate processing of the thread, since the device has been serviced. If the scope had not requested service, after the if/then icon 1108 fires (in this case not sending data to the counter 1110), sequence information will be sent to the spoll icon 1114 which will poll a digital volt meter (DVM) device to determine if this device requested service. The information returned will be sent to the if/then icon 1116 which will test bit 7 of this new data. If the bit is set, the DVM is requesting service so data will be sent to counter icon 1118 which will increment a counter. A sequence signal will then be sent to the next icon 1120 which will reset the thread. In the manner described above, all devices on a bus can be serviced. ICON DEVICE RULES 1. All input pins must be connected; output pin connections are optional. 2. Input pins allow only one trace connection per pin; output pins allow one or more trace connections per pin. 3. A device executes only when each input pin has received data. 4. If the Sequence input is connected, the device will execute only after this input has receive a signal. 5. Sequence Out fires (sends a sequence signal) only after all other data output pins have fired, and even then only after propagation, along all standard output lines, has continued as far as possible. THREAD RULES 1. A device which is connected to another device is considered to be on the same thread as that device, thus an unconnected device is its own thread. 2. Devices which are connected in parallel directly to the output of any other device will not be guaranteed to execute in any particular or even the same order from one load of the program to the next. 3. Execution can be "pulled" across data and sequence connections as well as "pushed". 4. A device that has no input connections, and thus no sequential constraints, but does have one or more output connections will be executed only when "pulled" across one of its output lines unless no start icon device is present on the thread--in which case it may be executed at an unpredictable time prior to being "pulled" from the next device. 5. Start icon devices are not required for a thread unless a feedback loop is present on the thread. If a feedback loop is present, a start icon device is required in order to guarantee normal order of execution (a user will be told of the need for a start icon, at run time, if a feedback loop is detected and no start icon is present). 6. Multiple start devices on the same thread result in multiple entry points for the thread; all start icons will fire before any other icon devices on the thread. The order of execution of the several start icons will not be guaranteed, nor will the order of execution from one load of the program to the next. 7. Execution of a thread having no start icon device will proceed "correctly" as far as the sequencing constraints implied by the device connections, but the order of execution of two or more independent and parallel subthreads will not be predictable. 8. Parallel threads are executed in round-robin style with each thread getting the processor for one primitive icon per cycle, excluding iteration icons and any form of multiple icon construct such as an iconic subprogram.

Claims: In an iconic programming system process executing in an operating environment, a method for processing service requests from other devices comprising the steps of: (a) starting processing of all threads within the iconic programming system; (b) stopping processing on any thread when a wait for service request icon is to be fired; (c) if a service request occurs, stopping processing on all threads except the subthread hosted by a wait for service request icon; and (d) after processing the subthread hosted by the wait for service request, continuing processing on all other threads. The process of claim 1 further comprising the step of: (c1) setting a priority of all subthreads hosted by a wait for service request icon to a priority higher than all threads not hosted by a wait for service request. The process of claim 1 further comprising the step of: (c1) setting a priority of all threads hosted by a wait for service request icon to a highest possible priority.

Inventors: BEETHE DOUGLAS C, BEETHE, DOUGLAS C.
Applicants: HEWLETT PACKARD CO, HEWLETT-PACKARD COMPANY
Application year: 1992
Main classification: G06F9
IPC codes: G06F9