views:

194

answers:

2

Are there any issues with changing elements which will appear on a web page within a thread. I am from a windows programming background and obviously if a thread needs to change the GUI in some way you have to delegate it to the GUI thread.

Basically my page uses 3 sql queries which can be run concurrently to obtain the page data. So I setup 3 threads and have them run, if one fails or has no records it makes an error message visible about it, this is currently done within the thread and seems to work.

Note: The 3 sql queries are for very different data it is definitely fastest to run 3 separate queries and running them at the same time makes it even faster (In terms of how long it takes the page to display).

Edit: The threads are joined in the page load event

+1  A: 

You're going to have to join all 3 threads before rendering the page. Once it's rendered out, there's no updating it.

GeekyMonkey
I did join them and it seemed ok just checking
PeteT
A: 

Basically asp.net rendering is about building a large string, which will be the rendered output, which is a html page. (Not counting dynamic image rendering and such.) So the short answer is no, above any "normal" threading issues.

gerleim