We have an application written in Delphi Tokyo in which we use ADO components to connect to an SQL database. The whole application uses the same connection and a single thread.
Because we are dealing with some performance issues we consider the possibility of some things running in separate threads "in the background" so that the user does not have to wait for the delay. For example:
- When the user presses the "Save" button, we have procedures (SQL commands like INSERTs, UPDATEs) which run right when saving the record to the database.
The user should not wait for all this work to end - we thought to put what is running when saving into another thread that will run "in the background".
- Is this something that is common practice?
- Are there "processes" within an application that you usually put in a separate thread?
- Could someone advise me what to look out for when starting to use more than one thread in an application?