Difference between revisions of "CoCoA:User Interface Guide Notes (4.4)"

From ApCoCoAWiki
m (minor cleanup)
Line 1: Line 1:
=When can a computation be interrupted?=
+
=When Can a Computation be Interrupted?=
 
In principal, a running computation can always be interrupted. However, a computation that seems to be running, may in fact have terminated a while ago. The reasons for this lies in the architecture which will be explained below.
 
In principal, a running computation can always be interrupted. However, a computation that seems to be running, may in fact have terminated a while ago. The reasons for this lies in the architecture which will be explained below.
  
Line 10: Line 10:
 
After you execute this command set, the engine produces text events which are then processed by the interface. However, while the interface is processing these events, the engine might already have terminated. But if that is the case, there is not computation to interrupt anymore. And thus you can't stop the output from appearing.
 
After you execute this command set, the engine produces text events which are then processed by the interface. However, while the interface is processing these events, the engine might already have terminated. But if that is the case, there is not computation to interrupt anymore. And thus you can't stop the output from appearing.
  
=Measuring execution time=
+
=Measuring Execution time=
 
In addition to CoCoAs builtin Time keyword which measures the time the CoCoA engine needs to complete a computation, CoCoA shows the total time needed to execute a command set and show the results on the screen after each computation in the status bar. Because of the asynchronous architecture of CoCoA mentioned above these times might differ greatly.
 
In addition to CoCoAs builtin Time keyword which measures the time the CoCoA engine needs to complete a computation, CoCoA shows the total time needed to execute a command set and show the results on the screen after each computation in the status bar. Because of the asynchronous architecture of CoCoA mentioned above these times might differ greatly.
  

Revision as of 04:19, 22 September 2005

When Can a Computation be Interrupted?

In principal, a running computation can always be interrupted. However, a computation that seems to be running, may in fact have terminated a while ago. The reasons for this lies in the architecture which will be explained below.

CoCoA consists of two components, the engine and the interface. These two components are both running in separate threads and communicate asynchronously. Whenever the engine produces output, it posts an event to the event queue of the interface, which then processes these events. Let's explain this using a short example:

For I := 1 To 20000 Do
  Print I, " ";
End;

After you execute this command set, the engine produces text events which are then processed by the interface. However, while the interface is processing these events, the engine might already have terminated. But if that is the case, there is not computation to interrupt anymore. And thus you can't stop the output from appearing.

Measuring Execution time

In addition to CoCoAs builtin Time keyword which measures the time the CoCoA engine needs to complete a computation, CoCoA shows the total time needed to execute a command set and show the results on the screen after each computation in the status bar. Because of the asynchronous architecture of CoCoA mentioned above these times might differ greatly.

Interactive Document Close Dialog

When you try to close CoCoA a dialog will be shown warning you that any unsaved changes to the Interactive Document will be lost if you continue. You can prevent the showing of this dialog by selecting "Don't show this dialog again". However, if you decide you want to see this dialog again everytime you quit CoCoA, you have to quit CoCoA and change the 1 in the line

showInteractiveDocumentCloseWarning=1

of the configuration file (which is normally named .xcocoarc or wincocoa.ini) to a 0. A future version of CoCoA will let you change this in the standard configuration dialog.