Re: multithreaded tcp/ip server large page file



I'll spare you all the details but it's started from the class "sessionclass" which has only one sub "ThreadMain" like this:

Dim oSession As SessionClass
Dim oThread As Thread
oThread = New Thread(AddressOf oSession.ThreadMain)
oThread.Start()

It's my understanding that when the sub ThreadMain ends the tread also ends. This is true right? I have not heard of closing a thread handle.

The first thing that ThreadMain does is increment a counter and the last thing is decrement the counter. The counter is another class which uses synclock to keep the threads from conflicting with eachother. This counter is read an displayed by a timer in the main program to show how many threads are running at any given time. It usually runs between 1 and 3. Part of the processing being done by each thread is contacting a sql server and if the sql server is having problems processing by this program backs up and I've seen it with over 100 threads open before. It handles it fine as the sql request time out this program returns and error response to the TCP/IP client that the thread is handling and the sub/tread ends. It just takes much longer to timeout than to get a response from SQL most of the time so during those times the concurrent thread count will be much higher.

Charles Wang[MSFT] wrote:
Hi cj,
How did you end your thread? Generally if a thread handle is closed, the related virtual memory will be released.
I recommend that you use Process Explorer to monitor your application to check if the threads handles were closed after they ended.
You can download the tool from:
http://www.microsoft.com/technet/sysinternals/utilities/ProcessExplorer.mspx

Open Process Explorer, click View->Show Lower Panel, select Lower Panel View-> Handles.

You may check if the thread number is growing and the handles are not closed.

Best regards,
Charles Wang
Microsoft Online Community Support
=====================================================
Get notification to my posts through email? Please refer to:
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications

If you are using Outlook Express, please make sure you clear the check box "Tools/Options/Read: Get 300 headers at a time" to see your reply promptly.


Note: The MSDN Managed Newsgroup support offering is for non-urgent issues where an initial response from the community or a Microsoft Support Engineer within 1 business day is acceptable. Please note that each follow up response may take approximately 2 business days as the support professional working with you may need further investigation to reach the most efficient resolution. The offering is not appropriate for situations that require urgent, real-time or phone-based interactions or complex project analysis and dump analysis issues. Issues of this nature are best handled working with a dedicated Microsoft Support Engineer by contacting Microsoft Customer Support Services (CSS) at http://msdn.microsoft.com/subscriptions/support/default.aspx. ====================================================== When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from this issue. ======================================================
This posting is provided "AS IS" with no warranties, and confers no rights. ======================================================





.



Relevant Pages

  • RE: cannot delete a record in sql server 2005 through asp program
    ... Using trace script he provided and trace file created by the script. ... SQL Server database by the asp application. ... Microsoft Online Community Support ... a Microsoft Support Engineer within 2 business day is acceptable. ...
    (microsoft.public.sqlserver.programming)
  • Re: Intermittent work in UI thread
    ... Thank you again Joseph, that is exactly what I was trying to do. ... The MSDN Managed Newsgroup support offering is for non-urgent issues where an initial response from the community or a Microsoft Support Engineer within 1 business day is acceptable. ...
    (microsoft.public.vc.mfc)
  • Re: enumerating Sql Servers is wrong on some systems
    ... How do we get the correct enumeration? ... I know that you install a SQL Server named ... Microsoft Online Community Support ... a Microsoft Support Engineer within 2 business day is acceptable. ...
    (microsoft.public.sqlserver.setup)
  • Re: multithreaded tcp/ip server large page file
    ... Part of the processing being done by each thread is contacting a sql server and if the sql server is having problems processing by this program backs up and I've seen it with over 100 threads open before. ... It handles it fine as the sql request time out this program returns and error response to the TCP/IP client that the thread is handling and the sub/tread ends. ... The MSDN Managed Newsgroup support offering is for non-urgent issues where an initial response from the community or a Microsoft Support Engineer within 1 business day is acceptable. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: multithreaded tcp/ip server large page file
    ... Part of the processing being done by each thread is contacting a sql server and if the sql server is having problems processing by this program backs up and I've seen it with over 100 threads open before. ... It handles it fine as the sql request time out this program returns and error response to the TCP/IP client that the thread is handling and the sub/tread ends. ... The MSDN Managed Newsgroup support offering is for non-urgent issues where an initial response from the community or a Microsoft Support Engineer within 1 business day is acceptable. ...
    (microsoft.public.dotnet.languages.vb)

Loading