Re: Sleep function in vb.net

Tech-Archive recommends: Fix windows errors by optimizing your registry



Nobody wrote:
"Mike" <unknown@xxxxxxxxxx> wrote in message news:uYz$V794JHA.1420@xxxxxxxxxxxxxxxxxxxxxxx
Context 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.

--
.



Relevant Pages

  • Re: Problem with mlockall() and Threads: memory usage
    ... We do want improved latency, but with reasonable memory usage. ... With 20 threads runing the system will lock 160MBytes of memory just for stack ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: java.lang.StackOverflowError
    ... could i avoid the stackoverflow by resizing the ... stack, that eclipse should set really small by default value as some ... then you're memory usage is probably exponential ...
    (comp.lang.java.programmer)
  • Re: How to get process info from python
    ... '''Return process memory usage in bytes. ... '''Return process stack size in bytes. ... >> I've had to work with process data in the past, and you're right, a ... >> the module's functionality. ...
    (comp.lang.python)
  • Re: Sleep function in vb.net
    ... Swaps in the Next thread Y code, stack, memory usage from storage, ... Cmp EAX, B ' Compare EAX with B, and saves the result to CPU's flags ...
    (microsoft.public.dotnet.languages.vb)
  • Re: MMO-Champion gold guide
    ... Tonight they posted a glyph guide using QA2. ... Azeroth runs a deflationary economy. ... that you would normally make a profit on when on other servers, ... as oftern floods will cause the price to drop to 20 silver a stack. ...
    (alt.games.warcraft)