bpetty
24th March 2008, 22:33
Hey guys,
I am writing a simple app that tests various ODBC calls and SQL statements to analyze performance. It can spawn many threads... each thread, for example, could run a query over and over again, gathering statistical data for the run.
I have a QTableWidget that I am wanting to use to view this data. Each threads gets its own row in the table.
I was wonder if it was safe to have each thread update its own row. I think it would be safe since it is essentially a node based container and I am only updating the values of existing nodes.
Would it be better if I have a timer on my main thread that polls data from my worker threads so that it would be responsible for updating the QTableWidget instead of each thread updating their own row?
I am writing a simple app that tests various ODBC calls and SQL statements to analyze performance. It can spawn many threads... each thread, for example, could run a query over and over again, gathering statistical data for the run.
I have a QTableWidget that I am wanting to use to view this data. Each threads gets its own row in the table.
I was wonder if it was safe to have each thread update its own row. I think it would be safe since it is essentially a node based container and I am only updating the values of existing nodes.
Would it be better if I have a timer on my main thread that polls data from my worker threads so that it would be responsible for updating the QTableWidget instead of each thread updating their own row?