Re: Sleep function in vb.net
- From: Mike <unknown@xxxxxxxxxx>
- Date: Wed, 03 Jun 2009 23:17:56 -0400
Nobody wrote:
"Mike" <unknown@xxxxxxxxxx> wrote in message news:uYz$V794JHA.1420@xxxxxxxxxxxxxxxxxxxxxxxContext switching (CS) is a very expensive Windows and CPU operation. A CS is when the WINDOWS:
- Stops the current thread X in the CPU (preemption),
- Swaps out all its code, stacks and memory usage, stores it,
- Swaps in the Next thread Y code, stack, memory usage from storage,
You probably know this already, but one can interpret your comments incorrectly.
I agree. Thanks for pointing that out.
The code and stack themselves are not swapped, but the instruction and stack pointers are swapped, along with other registers such as the stack pointer.
I should of just said "thread context" but I was trying to be general - too general. :-)
You have to be careful when accessing shared resources, or global variables.
Sure, thread synchronization and the various sync methods available is very important in the area of read/write contention and dead locks prevention. Multi-thread design is an art and takes many years to master all the concepts involved.
One of the reasons I decide to more forward with VB.NET is because it is more optimized than VB6 and has a common footprint with C++/CLR and C#.
Probably after we get some basic applications ported to VB.NET with the new .NET SDK wrapper I've been working on for the past month or so, we might look VB.NET threads for some of our simple multi-thread hosting applications which are all coded under C/C++. I am thinking of porting these set of C/C++ class libraries I contributed to codeproject.com either to VB.NET or C# one day soon.
http://www.codeproject.com/KB/IP/cspserver.aspx
We use this for all our internet hosting servers - SMTP, POP3, IMAP, FTP and other internal client/server protocol servers. They are all RPC clients to a centralize RPC server that manages the users, files, mail and security database with a 250 API SDK.
--
.
- References:
- Sleep function in vb.net
- From: John
- Re: Sleep function in vb.net
- From: Mike
- Re: Sleep function in vb.net
- From: Nobody
- Sleep function in vb.net
- Prev by Date: Re: Swapping (was Re: Sleep function in vb.net)
- Next by Date: RE: Get url for pdf file from AxSHDocVw.AxWebBrowser
- Previous by thread: Re: Sleep function in vb.net
- Next by thread: OnCtlColor()
- Index(es):
Relevant Pages
|