multithreadingforkgenero

Finding a fork() equivalent in Genero


I'm looking to test some table-locking in Genero. Does Genero have an equivalent to C's fork() function? I've checked Genero documentation at: http://www.4js.com/online_documentation/fjs-fgl-manual-html/ but haven't come up with anything useful yet. Hopefully I'm just missing something?


Solution

  • No, Genero by design is single threaded. RUN can be used to start another process but will not pass variables, databases connections etc across to the new process.

    If you are using the DATABASE command to connect to the database, you could use the CONNECT statement instead http://www.4js.com/online_documentation/fjs-fgl-manual-html/?path=fjs-fgl-manual#c_fgl_Connections_042.html. This allows you to have more than one database connection and so potentially could allow you to test table locking scenarios from within the one program