PgDAC in multi-thread environment does not work properly
Posted: Tue 12 Jun 2018 17:45
I have a problem with PgDAC (5.1.5) in a multi-thread environment. Each thread creates an own connection with an own SELECT-query, opens that query and iterates through it by using Eof and Next. While iterating it reads all the data from the records' fields. The queries are running through large tables, that's why multiple threads are required.
If only one thread is started the iteration (including reading data) lasts about 5 seconds. If two threads are started each thread lasts about 10 seconds. And if three threads are started each lasts about 15 seconds.
So it looks as if there is something in PgDAC that locks the threads and makes them do their work sequentially.
My expectation was that the iteration within a thread would only take about 5 seconds regardless of the number of threads.
How can this be solved?
If only one thread is started the iteration (including reading data) lasts about 5 seconds. If two threads are started each thread lasts about 10 seconds. And if three threads are started each lasts about 15 seconds.
So it looks as if there is something in PgDAC that locks the threads and makes them do their work sequentially.
My expectation was that the iteration within a thread would only take about 5 seconds regardless of the number of threads.
How can this be solved?