Re: The best way to yield processor to other users for long-runnin

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Mike D Sutton (EDais_at_mvps.org)
Date: 01/13/05


Date: Thu, 13 Jan 2005 01:10:15 -0000


> Somebody suggested to create a separate thread for every request that client
> requested. If another request is made another thread would be instantiated.
> Can the above be done with ActiveX exe ? If not , how can I create a
> separate thread in VB ?

Yup, but it may be an idea to put an upper cap on how many requests can be run asynchronously, for a start while the system will
manage them it will be splitting it's processing speed between them so the more that are running at any one time, the slower each
will run.
It would be better to keep a 'thread pool' (or in this case an ActiveX EXE pool) of a set number of objects and simply re-use these
once one finishes it's job assuming you have lots of requests.
I'd suggest having a look around for examples on this if you're unsure of the implementation details since which should answer your
questions on the subject.
Unfortunately you can't simply create other threads in VB (at least not without some serious hacking) so the ActiveX EXE method,
which runs in its own thread, is about as close as you get unless you want to migrate that section of code to another language that
properly supports threading.
Hope this helps,

    Mike

 - Microsoft Visual Basic MVP -
E-Mail: EDais@mvps.org
WWW: http://EDais.mvps.org/



Relevant Pages

  • Re: The best way to yield processor to other users for long-runnin
    ... Somebody suggested to create a separate thread for every request that client ... If another request is made another thread would be instantiated. ... Can the above be done with ActiveX exe? ...
    (microsoft.public.vb.general.discussion)
  • Every ASP.NET application - a multithreaded windows app?
    ... Then, a separate thread is issued to serve my page request, and it ... windows app which happens to listen on port 80? ... ASP.NET application, to process some complex tasks, and letting users use ...
    (microsoft.public.dotnet.framework.aspnet)
  • Callback Delimma...
    ... A separate thread will be monitoring the central RESPONSE ... that made the request. ... So the monitoring thread will simply receive ...
    (microsoft.public.dotnet.framework)
  • Re: The best way to yield processor to other users for long-runnin
    ... > the ActiveX EXE, why in my case it does not return from the ActiveX EXE to ... Due to the synchronous nature of VB, once you call a method it will wait until the method has finished before returning control to ... By simply setting up a timer and getting out of the method, control is returned back to whatever called it ... processing the request leaving your main application free to respond to user input or other requests. ...
    (microsoft.public.vb.general.discussion)
  • Re: Catalyst SocketWrench vs Winsock
    ... Yes, in the AX exe I have a timer with time interval = 1, ... last request the priority, ... >> I have a main application that calls ActiveX exe (to ...
    (microsoft.public.vb.general.discussion)