Safe multithreading in web application

N

Need2CSharp

Hi All,

Following is a quote from an article on MSDN.

Article Title: Safe, Simple Multithreading in Windows Forms
URL:
http://msdn.microsoft.com/library/en-us/dnforms/html/winforms06112002.asp?frame=true

Language: C#

"The use of Invoke has finally given me a safe use of multithreading in
my Windows Forms application. The UI thread spawns a worker thread to
do the long-running operation, and the worker thread passes control
back to the UI thread when the UI needs updating."

This is a great article, and comes in handy if your working with
Windows Forms.

But what if you're working with web applications? What is the
underlying UI thread? For instance, I cannot simply use
"this.Invoke(.....)" in a web application on my form(s).

Can someone please help me? Any suggestions will be greatly
appreciated.

My goal is to have a page with some user input textboxes, and a larger,
multiline textbox. Ideally, I'd like the multiline textbox to update
continually, using worker threads to gather information (based on the
user input) and pass it back to the main UI thread to update the
multiline textbox - a scrolling effect would be nice.

I've tried simulating the aforementioned Windows Forms model using
AJAX, but the process doesn't work as well as I'd like - especially
considering I'd like to return more complex datatypes from my methods.

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,783
Latest member
RickeyDort

Latest Threads

Top