Multithreading RRS feed

  • Question

  • User1848701346 posted

    Im new to ASP.NET but I have worked long time in C# Windows Forms.I have written app in C# that runed all day and night on my separate PC and decided to port it to server to free my pc and internet connection.Application consist of time consuming loops which i couldn't fit in into ASP.NET because of rendering and displaying result so I used timer and broked it to small loops and dispalayed result after each smaller loop.First question would be can I use multithreding in ASP.NET to have woker threads and UI updating thread like in forms or thread pool?

    I have paid hosting so I don't know do I have to worry about consuiming too much resource from server,like in php executing limits?

    To countinue..

    So becuse application was slower 100X then on my pc mainly because of lack of mutlithreading I decided to write manager web form so when it gets too much data it opens new web form and pass it some data to work on,and this form would close itself on finish.Im meantime if manger form got large amount of data agian it would open up same worker form separatly and pass it data agian.

    Problem agian because two worker web forms that should work in same time used same variables from session and second form just continues where first is curently left.

    So now I have two same web form opened twice,and solved session variables with assigning id to each opened form.

    Now I have biggest problem I get the feeling that this same worker form opened twice is blocking each other while working,is this due to session or something? because if this was true then when user would open website and someone else opened it in same time it would block each other.

    Would I solve it by running this each form on spearate thread?

    Hope this isn't to complicated.


    Thursday, December 30, 2010 8:32 AM

All replies

  • User-359936451 posted

    There are a few issues with your design. First yes, threading is possible. Secondly, there are a number of "time outs" that you will need to handle. There are,

    <sessionState timeout="10"/>

    <httpRuntime executionTimeout="110" />

    <forms loginUrl="~/default.aspx" slidingExpiration="true" timeout="10" requireSSL="true"/>

    and IIS has a few timeouts for long running processes as well.

    I would either redesign your program to run differently or buy a faster computer.

    Thursday, August 7, 2014 2:29 PM