Is the gixsql library thread-safe (= could it be used from multiple threads in the same COBOL run unit)?
Are all drivers thread-safe?
Note: I do know that GnuCOBOL's libcob is not thread-safe (it uses static buffers between some calls, for example for INSPECT so those access would need to be adjusted or otherwise guarded)
A side question:
Does the gixsql-library use multiple threads on its own?
Should it?
I've just recognized that the oracle client library - at least when used with procob generated COBOL programs - opens at least one additional thread. Threading may be beneficial for:
converting of several columns to/from DB data, for example string/integer conversions
multi-row handling, for sequential reads where multiple rows get back from the DB, the first row can be prepared, then get back to the COBOL program while a separate thread prepares the next row to be directly available to COBOL (or be thrown away if it isn't fetched next)
cleanup -> fire and forget (store everything for COBOL, then go back - and do any cleanup in a thread)
The main questions are:
Note: I do know that GnuCOBOL's libcob is not thread-safe (it uses static buffers between some calls, for example for
INSPECT
so those access would need to be adjusted or otherwise guarded)A side question:
I've just recognized that the oracle client library - at least when used with procob generated COBOL programs - opens at least one additional thread. Threading may be beneficial for: