4D v13.4

Process page

Home

 
4D v13.4
Process page

Process page  


 

 

On the Process page you can graphically view the CPU time consumed as well as various other information for each process created in the database. You can show or hide the graphical display of each process by clicking on the expansion icon to the left of the process’s name. There are also several tools available for the processes. For more information about processes in 4D, refer to the Processes section in the 4D Language Reference manual.

Note for 4D Server: The Process page of the Runtime Explorer on a 4D client controls the processes of this 4D client. The Processes Page of the administration window of 4D Server controls all the processes of all the client machines connected to the server.

For each process, the page provides the following information:

  • Process number (process ID, which is the same as the process number. You use this process ID to identify a specific process in commands and functions).
  • Process name,
  • Current status of the process,
  • Total amount of execution time in seconds that the process has taken since it was started,
  • The graphical representation of the status and CPU time allocated to a process. For each process you can hide or display its graph by clicking on the icon located to the left of the process name. You can also hide or display all the graphs at once using the Alt+click (Windows) or Option+click (Mac OS) shortcut on this icon.

Each process has a unique number (in parentheses) which corresponds to the order it was created during the session underway. When the application is started, the first numbers are assigned to the processes created automatically by 4D (their number will vary according to the servers executed on startup).

When you start your own process, it either appears as the next process in sequence or takes the place of a process that has been aborted. For example, suppose processes 7 and 8 are executing. If process 7 is aborted, the next process to be started becomes process 7.

Note: Processes are automatically aborted upon completion. You can abort a process before it has completed using the Runtime Explorer. For more information about aborting a process, see Aborting a process.

If you start a new process using New process or Execute on server, you can specify its name as a parameter to the function. The name specified in the parameter appears as the process name in the list of processes.

If you do not specify a process name using a command, 4D automatically assigns the process a default name. Default names are based on the method used to start the process, as follows:

  • Processes started from a menu command: If you start a process from a menu command, the process is given the default name “ML_ProcessNumber.” For instance, if process number 7 is started when a menu command is selected, the process is given the name “ML_7.”
  • Processes started from executing a method: If you start a process from the Execute Method dialog box or directly from the Method editor, the method is given the default name “P_ProcessNumber.” For instance, if process number 8 is started programmatically, the process is given the name “P_8.”
  • Processes started using a command, but not explicitly named: If you start a process using a method but do not specify the name as a parameter to the New process command, the process name is left blank.

Note for 4D Server: If the name of a process begins with a dollar sign ($), it is a local process that does not have access to tables or 4D Server (see Global and Local Processes).

The status of a process is the current state of its execution — what the process is actually doing. In the Runtime Explorer, the status of the process is indicated by the icon located to the left of the process name and by the text located next to the process name.

The following is an explanation of each status that can appear in the Runtime Explorer window:

  • Executing: The process is currently executing.
  • Delayed: The process is delayed for a specific amount of time. During the period that the process is delayed, it does not take up any processing time. For information about how to delay a process, refer to the 4D Language Reference manual.
  • Waiting Event: The process is waiting for an action from the user such as a button being clicked or a menu command chosen.
  • Waiting I/O: The process is waiting for some input or output to occur. For example, a process might need to wait while a group of records is being updated to disk.
  • Waiting Semaphore: The process is waiting for the internal processes to finish executing 4D database tasks.
  • Paused: The process is paused until you tell it to resume execution. During the period that the process is paused, it does not take up any processing time. For more information, see Pausing and resuming a process.
  • Aborted: The process has been terminated. When a process is aborted, 4D frees any locked records, cancels any transactions opened by the process but not yet validated or canceled, and frees the current selection and current record. Processes are automatically aborted upon completion. You can also abort a process before it has completed by using the Runtime Explorer. For more information about aborting a process, see Aborting a process.
  • Hidden Modal Dialog: A process which was displaying a modal dialog box has been hidden so that the user can no longer view the dialog box. The process will remain in this state until the dialog is shown again.

In managing processes, 4D divides processing time among existing processes so that no single process is executing at every moment. Thus, the process time is the total amount of execution time a process has taken (in seconds) since it started executing. Note that the process time does not reflect the total amount of time that has elapsed since the process started executing since, in reality, execution alternates between all open processes. 

The Runtime Explorer displays the processing time for each process. If you expand the process graph, it displays the following information:

You can modify the frequency at which data should be updated —which can be every one, two, or three seconds. To do so, choose a value from the “Update frequency” menu found at the bottom of the window. The greater the update time is, the more CPU time is consumed by the Runtime Explorer process. The number of processes to graphically represent on screen also influences the CPU time consumed by the process.

Note: No CPU time is consumed for a process when its graphical representation is closed.

When you click in the graphical area, a vertical line appears where you clicked and a tip indicates the state of the process at that instant. By holding down the mouse button and moving it from side to side, you can view the changes in the status of the process. 

The Runtime Explorer allows you to control the execution of processes by pausing, resuming, or aborting a process. You can also choose to run a process in debug mode. Lastly, you can hide and redisplay its windows at any time. These operations are covered in detail in the sections below.

Note: You can also delay a process for a specific period of time. For more information about delaying a process, refer to the 4D Language Reference manual.

You can temporarily suspend the execution of a process by pausing it. You may want to pause a process to give other processes more execution time or to allow an event upon which the process depends to occur.

For instance, suppose you start a process that prints a selection of records. You then realize that you want to modify the data in one of the records so you first pause the process, finish your modifications, and then resume the process to continue printing the records.

  • To pause a process, select it and click the Pause button . The status of the process in the Runtime Explorer window automatically changes to “paused.” The process remains paused indefinitely until you tell it to resume execution.
  • To resume execution of a process, select it and click the Resume button . The status of the process returns to the status it had at the time it was paused. For example, if the process was executing before it was paused, the process begins executing again. If the process was waiting for an event before it was paused, it continues waiting for an event.

A process is automatically aborted upon completion. However, you may need to abort a process before it completes for debugging purposes. Processes should not be aborted for any other reason. To stop the process from continuing execution, you abort the process in the Runtime Explorer.

When a process is aborted, 4D frees any locked records, cancels any transactions opened by the process but not yet validated or canceled, and frees the current selection and current record.

To abort a process, select it and click the Abort button . The status of the process in the Runtime Explorer automatically changes to “aborted.”

You can debug a process by monitoring its execution in the 4D debugger. 

To debug a process, select it and click the Trace button .

If the process is being executed, the 4D Debug window appears, allowing you to debug the process by stepping through its execution and evaluating expressions such as the values of fields and variables used in the method. If the process was paused, 4D “stores” the request and displays the Debug window as soon as the execution of the process resumes.

For information about using the Debug window, refer to the 4D Language Reference manual.

You cannot debug the internal processes created and managed by 4D.

You can make a process invisible in the Application environment by hiding it. When a process is hidden, any windows or menus created by the process are invisible to the user while it is executing. 

Hiding a process is useful for operations in which you open a window which you later want to close. Instead of aborting the process to close the window, you can make the window invisible to the user by hiding the process that opened it. Even though the window is hidden, the process continues to execute and complete the operation it began.

To hide a process, select it and choose the Hide command in the options menu:

The process is now hidden from view in the Application environment. Note that it continues to execute even though it is hidden.
You can display a hidden process at any time.

To display a process again, select the Show command in the options menu. The process is displayed again in the Application environment.

You can make a window the frontmost window by bringing its process to the front. For instance, if the Application process is brought to the front, the Application environment is brought to the front of the screen.

You can bring any user processes to the front. If you have created a window for a process, the window becomes the frontmost window on the screen. If a menu bar is attached to the window, 4D brings the menu bar to the front of the screen and makes its menus the current menus. The current menu bar is replaced by the menu bar of the process that is brought to the front.

To bring a process to the front, select it and choose the Bring to Front command in the options menu:

Any windows attached to the process are brought to the front of the screen. In addition, 4D displays the menu bar for the frontmost process window.

 
PROPERTIES 

Product: 4D
Theme: Runtime Explorer