Help on run-process call-backs

From: Giorgio Cesana <cesana_at_venus.sgs-thomson.it>
Date: Wed, 5 Apr 1995 18:18:28 +0200

Dear all,

I would like to add call-backs to run-process.

I tried the following experiment with success:

- I have added the following lines to the end of the process_terminate_handler
  function

...
          } while (--in_handler > 0);
#endif
        STk_eval_string(STk_makestring("(define process-changes #t)"),
                STk_global_environment());
}

- then, having built the function
(define (test)
        (run-process "sleep" "10")
        (tkwait 'variable 'process-changes)
        (display "PROCESS END\n"))

  calling the test function I obtain the following result:
  
  +++ the process is called, the function waits for the process end (even if
      I have not used :wait #t) then the message is displayed. While waiting
      for the process end, all the widgets and call-backs works correctly.

I made a little test and all seems to be ok. No core or bus errors occurrs.


Has anyone experienced in calling the STk_eval (or STk_eval_string) in any
point of the interpreter loop? The modification I introduced is really risky.
I would like to know if this may introduce same side effects.

The experiment was made in order to obtein non blocking calls. An improvement
could be the run of a call-back function directly by the run-process manager,
by adding a new field to the process_info structure (let's call it SCM call_back),
by initializing it with the run-process function using a new keyword (let's call
it :post-run), and by calling the correct post function in the
process_terminate_handler function using the STk_eval function.

I will try to add this new feature, but I would like to know if there will be
some problems with the interpreter loop: I really do not know how it works, and
I have no time to look at it.

Thanks a lot

Regards

Giorgio


-------------------------------------------------------------------------------

Giorgio Cesana | SGS-THOMSON Microelectronics
phone +39/39/603.6006 | Central R&D - DAIS
fax +39/39/603.5820 | via C. Olivetti, 2
e-mail cesana_at_venus.sgs-thomson.it | 20041 Agrate B.za (MI) - ITALY
Received on Wed Apr 05 1995 - 18:20:24 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST