I can't remember off the top of my head but there is a way to send data about how you are accessing the data, such as what type of user, browser capability ect. Look into how to set that and it may fix your problem.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
My question is: how is using EventsHelper.FireAsync() different from using EventsHelper.Fire() BUT having the listener's event handler spawn a new thread to do the work?
In my program, I have a data feed coming in and I have a separate form that has a DataGridView on it. Each time a message comes in (they come in very rapidly) I fire an event and the handler (which exists on the DataGridView's form) adds a row to the DataGridView.
Approach #1: use EventsHelper.FireAsync() to fire the events as they come in. This is nice because the slowness of adding rows to the DataGridView control doesn't slow down the incoming data feed AT ALL -- meaning, if there were other listeners to this event, their performance wouldn't suffer from the slow DataGridView. HOWEVER, this approach doesn't work because of the asynchronous nature, the rows aren't necessarily added in order (message 3 might be processed/added to the DataGridView before messages 1 and 2).
Approach #2: use EventsHelper.Fire() (the synchronous version), and in the event handler, spawn a BackgroundWorker that adds the message to the DataGridView. I don't like this approach because then EVERY handler of this event is going to have to do all this extra work, but I figured it was the only way I could ensure the messages (events) would be received in order. However what I noticed is this approach (spawning the BackgroundWorker thread) doesn't really give a speed improvement over simply doing ALL the work in the same event thread.
Why isn't approach #2, with a BackgroundWorker in the ONLY event handler as fast as approach #1?
I love the speed EventsHelper.FireAsync provides, but I need to maintain order of the events. If anyone has any advice, I'm all ears.
Well, I can only guess what EventsHelper is, but if I were to use my psychic debugging skills, I'd guess we're talking about something that calls delegates/events asynchronously.
To answer your question, my guess would be that EventsHelper.FireAsync may use a single background thread, whereas having the handlers each have their own has many threads. Just a wild guess though.
Here's what I recommend. When the data feed comes in, don't fire your event. Instead, have a queue, and every time data comes in, queue up a function that raises the event or actually updates the data, whatever you need it to do.
Combine that with Application.Idle event handler. This handler should check the queue for any queued up stuff, and if so, execute it. That way, you'll never flood your UI thread with the incoming data, the DataGridView will remain responsive, and you'll get your data in the correct order.
I am currently using Visual Studio 2005 Express Edition. I would like to get my hands on Visual Studio 2005 Standard Edition. If I am not mistaken there should be a Trial Version available. I have been searching and searching and searching but unfortunatly, I am unable to find the Trial Version online.
Can anyone tell me where I can find a Trial Version of Visual Studio 2005 Standard Edition?
not sure what you mean by "should". They have what the have, period. I would imagine that if you can't find it anywhere it doesn't exist. It's not like you're looking for something produced by a guy out of his garage.
If you have a driver, the camera probably appears as a removable USB drive. You can find lots of information about how to detect and access one of them if you Google it.[^]
If you don't have a driver one will need to be written first. You cannot do this in C#, it must be done in C/C++. Writing a driver is *not* an easy task, nor is it something that can be done by a beginning level programmer.
Help Stamp Out and Abolish Redundancy
The preceding is courtesy of the Department of Unnecessarily Redundant Repetition Department.
Do you want to be more specific about what exactly you're doing with the camera?? What kind of camera?? Is it attached USB?? Do you have drivers?? Are you trying to get a "live" image from the camera?? Are you just downloading images stored in the camera?? Does it show up as a "USB Storage Device" in Explorer??
Or should we just leave it at the less-than-meager explanation you've given and drop the whole idea?? I repeat - The quality (read: detail) of the question you ask is DIRECTLY responsible for the quality of the answer you get.
I am writeing windows service that makes use in MSMQ in .net 2003 in c#.
I user the method beginPeek(TimeSpan) and waiting for an message to arrive
the event handler look like this:
private void MyPeekCompleted(Object source,
// End the asynchronous peek operation.
Message m = _mq.EndPeek(asyncResult.AsyncResult);
//logic to handel message
if (e.MessageQueueErrorCode ==
// some code to handel error
after a while i get stackoverflow exception. event though no message arrives...
It works fike for a couple of minuts and than crushes..
How can i solve this..
Sample code will be greate help..
im using winXP
I have no experience in this, but I see a logical problem in your code.
the MSDN example has BeginPeek as the last statement in the PeekCompleted handler.
Yours has more than one BeginPeek, and they are not at the end, so if they complete
before you have left the Completed handler (Console.WriteLine will take some msecs),
a new one would be launched before the current one exits, consuming stack space.