multiple events at same time

Giganews Newsgroups
Subject: multiple events at same time
Posted by:  Ed White (EdWhi…@discussions.microsoft.com)
Date: Thu, 19 Feb 2009

I'm writing a program in VB.NET (VS 2008) using an external stock trading
platform. Under the platform, when a stock price changes, and event is
thrown.  With quite a few stocks, this event could be thrown multiple times
per second.  My question is, how does VB or dotNet handle an event when it is
already processing an event.  In other words, if an event is thrown and the
event code is being run, and while that is happening, another of the same
type of event is thrown again, what happens?  Does it finish processing the
first event before it handles the next one, or is the event handler
interrupted to process a new event and then it returns to processing the
first event?  The answer to this question has multiple implications,
including how variables in the event code are affected.

Replies