Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Multithreading

    Hi,

    I have to develop an application, whose main feature is: read data from
    DataBase, do many calculations, then write back the results to the DataBase,
    and finally show it to the user.

    This calculations are based on different formula, so i was thinking to
    develop a multithreaded Web Based application, in this order i have the
    following questions:

    Which aspects do i have to consider before, during and after the life cycle
    of the program?

    How many theads can be created simultaniusly on ASP.NET?

    Is there any configuration file to improve the threads performace?

    I would really appreacite any suggestions...!

    Thanks in advance...

    Boris



    Boris Condarco Guest

  2. Similar Questions and Discussions

    1. HttpModule Multithreading and instances
      I have a scenario where I log a resquest to a database table and update the request with a corresponding response including the response time. I am...
    2. multithreading with webservices
      hello, i have this issue: i'd like to create a method which simultaneously accesses 6 different search engines to look for some keywords and...
    3. How to force/config multithreading ?
      I made some tests. I made simple WebMethod with long loop. Then I run 5 instances of my client application. Each of them called mentioned...
    4. multithreading?
      How can I get started with multithreading in PHP? I have searched google etc, but it didnt turn much up. Thanks
    5. Segmantation fault with multithreading
      I have a multithrading program(daemon server) written by c++(GCC) under AIX4.X, I get segmentation fault problem when it runs several hours with...
  3. #2

    Default Re: Multithreading

    ASP.NET will handle all of your threading for you. It's not really like VB
    COM in that respect, basically, I think your assemblies in ASP.NET are free
    threaded, so it'll keep going until you say stop.

    One of the really great things about .net, it's all disconnected. You
    basically connect to the database to grab your data, do your processing
    'offline' so to speak, and reconnect to post your changes back to the
    database. In former ADO, you'd most likely of have had to stay connected to
    the database throughout your processing, which would quickly form a bottle
    neck under any sort of load (holding a connection to a database is the
    biggest waste of resource imaginable). With ADO.NET however, this doesn't
    exist as the time you're connected to the database is minimal.

    Your objects will run several instances concurrenly if you build your
    classes correctly. We do a lot of work that involves very very heavy
    processing on disconnected data, and this has never proven to be a big
    scalability problem.

    I don't believe there's any specific limit on the number of threads IIS
    (ASP.NET) can handle - it'll just keep on adding until your processor or
    memory resource starts to run out.

    As for configuration, there's always the odd tweak you can do, but if you
    follow good coding practice, my guess is it'll be ok.

    Paul
    "Boris Condarco" <bcondarco@sbef.gov.bo> wrote in message
    news:#6L17ebPDHA.1612@TK2MSFTNGP11.phx.gbl...
    > Hi,
    >
    > I have to develop an application, whose main feature is: read data from
    > DataBase, do many calculations, then write back the results to the
    DataBase,
    > and finally show it to the user.
    >
    > This calculations are based on different formula, so i was thinking to
    > develop a multithreaded Web Based application, in this order i have the
    > following questions:
    >
    > Which aspects do i have to consider before, during and after the life
    cycle
    > of the program?
    >
    > How many theads can be created simultaniusly on ASP.NET?
    >
    > Is there any configuration file to improve the threads performace?
    >
    > I would really appreacite any suggestions...!
    >
    > Thanks in advance...
    >
    > Boris
    >
    >
    >

    Paul Guest

  4. #3

    Default Re: Multithreading

    Wrong. There is a limit on the number of threads ASP.NET can manage.
    This limit is define in the machin.config file under the processmodel tag
    using the MaxWorkerThread attribute.
    This value can be change but above a certain value asp.net collapse.
    So, becarefull when you decide to create more threads.
    One solution could be to use the thread pool (ThreadPool class) in this case
    you will not create more
    thread but use the existing ones. But it's not a good idea if your task is
    takes a lot of time.

    "Paul" <paul@nospam.ever.somewhere.com> a écrit dans le message de
    news:0LoLa.3055$sh4.390669@newsfep2-win.server.ntli.net...
    > ASP.NET will handle all of your threading for you. It's not really like
    VB
    > COM in that respect, basically, I think your assemblies in ASP.NET are
    free
    > threaded, so it'll keep going until you say stop.
    >
    > One of the really great things about .net, it's all disconnected. You
    > basically connect to the database to grab your data, do your processing
    > 'offline' so to speak, and reconnect to post your changes back to the
    > database. In former ADO, you'd most likely of have had to stay connected
    to
    > the database throughout your processing, which would quickly form a bottle
    > neck under any sort of load (holding a connection to a database is the
    > biggest waste of resource imaginable). With ADO.NET however, this doesn't
    > exist as the time you're connected to the database is minimal.
    >
    > Your objects will run several instances concurrenly if you build your
    > classes correctly. We do a lot of work that involves very very heavy
    > processing on disconnected data, and this has never proven to be a big
    > scalability problem.
    >
    > I don't believe there's any specific limit on the number of threads IIS
    > (ASP.NET) can handle - it'll just keep on adding until your processor or
    > memory resource starts to run out.
    >
    > As for configuration, there's always the odd tweak you can do, but if you
    > follow good coding practice, my guess is it'll be ok.
    >
    > Paul
    > "Boris Condarco" <bcondarco@sbef.gov.bo> wrote in message
    > news:#6L17ebPDHA.1612@TK2MSFTNGP11.phx.gbl...
    > > Hi,
    > >
    > > I have to develop an application, whose main feature is: read data from
    > > DataBase, do many calculations, then write back the results to the
    > DataBase,
    > > and finally show it to the user.
    > >
    > > This calculations are based on different formula, so i was thinking to
    > > develop a multithreaded Web Based application, in this order i have the
    > > following questions:
    > >
    > > Which aspects do i have to consider before, during and after the life
    > cycle
    > > of the program?
    > >
    > > How many theads can be created simultaniusly on ASP.NET?
    > >
    > > Is there any configuration file to improve the threads performace?
    > >
    > > I would really appreacite any suggestions...!
    > >
    > > Thanks in advance...
    > >
    > > Boris
    > >
    > >
    > >
    >
    >

    Joël Guest

  5. #4

    Default Re: Multithreading

    learn something new every day :)

    "Joël" <jdescombes@netcourrier.com> wrote in message
    news:3efeabad$0$29928$79c14f64@nan-newsreader-02.noos.net...
    > Wrong. There is a limit on the number of threads ASP.NET can manage.
    > This limit is define in the machin.config file under the processmodel tag
    > using the MaxWorkerThread attribute.
    > This value can be change but above a certain value asp.net collapse.
    > So, becarefull when you decide to create more threads.
    > One solution could be to use the thread pool (ThreadPool class) in this
    case
    > you will not create more
    > thread but use the existing ones. But it's not a good idea if your task is
    > takes a lot of time.
    >
    > "Paul" <paul@nospam.ever.somewhere.com> a écrit dans le message de
    > news:0LoLa.3055$sh4.390669@newsfep2-win.server.ntli.net...
    > > ASP.NET will handle all of your threading for you. It's not really like
    > VB
    > > COM in that respect, basically, I think your assemblies in ASP.NET are
    > free
    > > threaded, so it'll keep going until you say stop.
    > >
    > > One of the really great things about .net, it's all disconnected. You
    > > basically connect to the database to grab your data, do your processing
    > > 'offline' so to speak, and reconnect to post your changes back to the
    > > database. In former ADO, you'd most likely of have had to stay
    connected
    > to
    > > the database throughout your processing, which would quickly form a
    bottle
    > > neck under any sort of load (holding a connection to a database is the
    > > biggest waste of resource imaginable). With ADO.NET however, this
    doesn't
    > > exist as the time you're connected to the database is minimal.
    > >
    > > Your objects will run several instances concurrenly if you build your
    > > classes correctly. We do a lot of work that involves very very heavy
    > > processing on disconnected data, and this has never proven to be a big
    > > scalability problem.
    > >
    > > I don't believe there's any specific limit on the number of threads IIS
    > > (ASP.NET) can handle - it'll just keep on adding until your processor or
    > > memory resource starts to run out.
    > >
    > > As for configuration, there's always the odd tweak you can do, but if
    you
    > > follow good coding practice, my guess is it'll be ok.
    > >
    > > Paul
    > > "Boris Condarco" <bcondarco@sbef.gov.bo> wrote in message
    > > news:#6L17ebPDHA.1612@TK2MSFTNGP11.phx.gbl...
    > > > Hi,
    > > >
    > > > I have to develop an application, whose main feature is: read data
    from
    > > > DataBase, do many calculations, then write back the results to the
    > > DataBase,
    > > > and finally show it to the user.
    > > >
    > > > This calculations are based on different formula, so i was thinking to
    > > > develop a multithreaded Web Based application, in this order i have
    the
    > > > following questions:
    > > >
    > > > Which aspects do i have to consider before, during and after the life
    > > cycle
    > > > of the program?
    > > >
    > > > How many theads can be created simultaniusly on ASP.NET?
    > > >
    > > > Is there any configuration file to improve the threads performace?
    > > >
    > > > I would really appreacite any suggestions...!
    > > >
    > > > Thanks in advance...
    > > >
    > > > Boris
    > > >
    > > >
    > > >
    > >
    > >
    >
    >

    Paul Guest

  6. #5

    Default Re: Multithreading

    I'm not sure from your message what you think multithreading can do for you
    in this application. You can use multithreading to run 2 or more different
    procecesses simultaneously, but from your description that isn't what you're
    after.

    HTH,

    Kevin Spencer
    Microsoft FrontPage MVP
    Internet Developer
    [url]http://www.takempis.com[/url]
    Big things are made up of
    lots of Little things.

    "Boris Condarco" <bcondarco@sbef.gov.bo> wrote in message
    news:%236L17ebPDHA.1612@TK2MSFTNGP11.phx.gbl...
    > Hi,
    >
    > I have to develop an application, whose main feature is: read data from
    > DataBase, do many calculations, then write back the results to the
    DataBase,
    > and finally show it to the user.
    >
    > This calculations are based on different formula, so i was thinking to
    > develop a multithreaded Web Based application, in this order i have the
    > following questions:
    >
    > Which aspects do i have to consider before, during and after the life
    cycle
    > of the program?
    >
    > How many theads can be created simultaniusly on ASP.NET?
    >
    > Is there any configuration file to improve the threads performace?
    >
    > I would really appreacite any suggestions...!
    >
    > Thanks in advance...
    >
    > Boris
    >
    >
    >

    Kevin Spencer Guest

  7. #6

    Default Re: Multithreading

    Thanks a lot guys for your helping me....! :-)

    "Paul" <paul@nospam.ever.somewhere.com> wrote in message
    news:GMKLa.6685$sh4.672834@newsfep2-win.server.ntli.net...
    > learn something new every day :)
    >
    > "Joël" <jdescombes@netcourrier.com> wrote in message
    > news:3efeabad$0$29928$79c14f64@nan-newsreader-02.noos.net...
    > > Wrong. There is a limit on the number of threads ASP.NET can manage.
    > > This limit is define in the machin.config file under the processmodel
    tag
    > > using the MaxWorkerThread attribute.
    > > This value can be change but above a certain value asp.net collapse.
    > > So, becarefull when you decide to create more threads.
    > > One solution could be to use the thread pool (ThreadPool class) in this
    > case
    > > you will not create more
    > > thread but use the existing ones. But it's not a good idea if your task
    is
    > > takes a lot of time.
    > >
    > > "Paul" <paul@nospam.ever.somewhere.com> a écrit dans le message de
    > > news:0LoLa.3055$sh4.390669@newsfep2-win.server.ntli.net...
    > > > ASP.NET will handle all of your threading for you. It's not really
    like
    > > VB
    > > > COM in that respect, basically, I think your assemblies in ASP.NET are
    > > free
    > > > threaded, so it'll keep going until you say stop.
    > > >
    > > > One of the really great things about .net, it's all disconnected. You
    > > > basically connect to the database to grab your data, do your
    processing
    > > > 'offline' so to speak, and reconnect to post your changes back to the
    > > > database. In former ADO, you'd most likely of have had to stay
    > connected
    > > to
    > > > the database throughout your processing, which would quickly form a
    > bottle
    > > > neck under any sort of load (holding a connection to a database is the
    > > > biggest waste of resource imaginable). With ADO.NET however, this
    > doesn't
    > > > exist as the time you're connected to the database is minimal.
    > > >
    > > > Your objects will run several instances concurrenly if you build your
    > > > classes correctly. We do a lot of work that involves very very heavy
    > > > processing on disconnected data, and this has never proven to be a big
    > > > scalability problem.
    > > >
    > > > I don't believe there's any specific limit on the number of threads
    IIS
    > > > (ASP.NET) can handle - it'll just keep on adding until your processor
    or
    > > > memory resource starts to run out.
    > > >
    > > > As for configuration, there's always the odd tweak you can do, but if
    > you
    > > > follow good coding practice, my guess is it'll be ok.
    > > >
    > > > Paul
    > > > "Boris Condarco" <bcondarco@sbef.gov.bo> wrote in message
    > > > news:#6L17ebPDHA.1612@TK2MSFTNGP11.phx.gbl...
    > > > > Hi,
    > > > >
    > > > > I have to develop an application, whose main feature is: read data
    > from
    > > > > DataBase, do many calculations, then write back the results to the
    > > > DataBase,
    > > > > and finally show it to the user.
    > > > >
    > > > > This calculations are based on different formula, so i was thinking
    to
    > > > > develop a multithreaded Web Based application, in this order i have
    > the
    > > > > following questions:
    > > > >
    > > > > Which aspects do i have to consider before, during and after the
    life
    > > > cycle
    > > > > of the program?
    > > > >
    > > > > How many theads can be created simultaniusly on ASP.NET?
    > > > >
    > > > > Is there any configuration file to improve the threads performace?
    > > > >
    > > > > I would really appreacite any suggestions...!
    > > > >
    > > > > Thanks in advance...
    > > > >
    > > > > Boris
    > > > >
    > > > >
    > > > >
    > > >
    > > >
    > >
    > >
    >
    >

    Boris Condarco Guest

  8. #7

    Default Multithreading

    I need a cross-platform way to execute PHP-scripts in multiple threads.
    The only way I can think of is to exploit the webserver this way:

    1. Store the thread's code in a separate script (e.g. thread.php)
    2. Put ignore_user_abort(true) in this script
    3. Make a HTTP request for thread.php to the webserver
    4. Close the connection immediately
    5. Continue in my initial script

    Is this the most convenient way of solving the problem, or does anyone
    have better solutions for this problem?

    --
    Tormod Fjeldskår
    [email]tormod@fritidsproblemer.no[/email]
    [url]http://tormod.fritidsproblemer.no/[/url]
    Tormod Fjeldskår Guest

  9. #8

    Default Re: Multithreading

    Can't think of anything better. You might want to keep the connection in
    your initial script, since Apache would send a SIG_KILL to PHP, running as
    CGI, when the connection gets dropped. Thread.php can use the connection as
    a way to communicate its progress back to the initial script. Something like
    this:

    $thread = fopen("http://localhost/thread.php", "r");
    while($s = fgets($thread, 1024)) {
    // do some reporting
    }
    // thread.php is done

    Uzytkownik "Tormod Fjeldskår" <to-fje@online.no> napisal w wiadomosci
    news:lZlzb.3351$Y06.59986@news4.e.nsc.no...
    > I need a cross-platform way to execute PHP-scripts in multiple threads.
    > The only way I can think of is to exploit the webserver this way:
    >
    > 1. Store the thread's code in a separate script (e.g. thread.php)
    > 2. Put ignore_user_abort(true) in this script
    > 3. Make a HTTP request for thread.php to the webserver
    > 4. Close the connection immediately
    > 5. Continue in my initial script
    >
    > Is this the most convenient way of solving the problem, or does anyone
    > have better solutions for this problem?
    >
    > --
    > Tormod Fjeldskår
    > [email]tormod@fritidsproblemer.no[/email]
    > [url]http://tormod.fritidsproblemer.no/[/url]

    Chung Leong Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139