asynchronous

ASP.NET MVC 2 asynchronous action with timeout

I want to write an asynchronous action in ASP.NET MVC 2 that waits up to 5 seconds for an event to occur. If the event occurs then the server responds with a result, otherwise the request times out. What is the best way to achieve this? ...

WCF <operation>Async methods not generated in proxy interface

I want to use the <operation>Asnyc methods rather than the Begin<operation>/End<operation> on my WCF service client proxy because I'm updating WPF controls and need to make sure they're being updated from the UI thread. I could use the Dispatcher class to queue items for the UI thread but that's not what I'm asking about.. I've configur...

DataGridView cell not redrawing when value changed asynchronously

I have a DataGridView whose cell values are changed via callback functions that are invoked asynchronously. In one case, I have a callback in the form of an Action<T>. I noticed that if I have a method public void MyMethod(T data) { } and I do: UpdaterObject.AddCallback(MyMethod); it works fine, but if I pass in the callback in this ...

What sense does asynchronous IO make if the thread is blocked anyway (see example)

Hello, I found an example for async ftp upload on msdn which does the following (snippet): // Asynchronously get the stream for the file contents. request.BeginGetRequestStream( new AsyncCallback (EndGetStreamCallback), state ); // Block the current thread until all operations ar...

Accessing configuration from asynchronous handler

Hello team, I recently came across an issue while developing an asynchronous handler based upon the guides available on MSDN: http://msdn.microsoft.com/en-us/library/ms227433.aspx According to my understanding of the guides, you are able to create a base handler that child classes may inherit from. These child classes can then be call...

Limiting the number of threads executing a method at a single time.

We have a situation where we want to limit the number of paralell requests our application can make to its application server. We have potentially 100+ background threads running that will want to at some point make a call to the application server but only want 5 threads to be able to call SendMessage() (or whatever the method will be)...

Guaranteed semaphore order?

The documentation for the .NET Semaphore class states that: There is no guaranteed order, such as FIFO or LIFO, in which blocked threads enter the semaphore. In this case, if I want a guaranteed order (either FIFO or LIFO), what are my options? Is this something that just isn't easily possible? Would I have to write my own Semaph...

Asynchronous subprocess on Windows

First of all, the overall problem I am solving is a bit more complicated than I am showing here, so please do not tell me 'use threads with blocking' as it would not solve my actual situation without a fair, FAIR bit of rewriting and refactoring. I have several applications which are not mine to modify, which take data from stdin and po...

Callbacks in Thrift Asynchronous Functions?

Hi all, In Thrift it is possible to use the oneway modifier to specify a call as asynchronous. Apparently, it's not possible to define a callback, though, to be executed when the execution of the function is completed. It seems that the only possibility I have is to give my Thrift client (PHP) some "server" capabilities, so that, when...

How do ansynchronous methods work

Hello, I'm wondering if anyone can help me understand some asynchronous javascript concepts... Say I make an asynch ajax call like so: xmlhttp=new XMLHttpRequest(); xmlhttp.onreadystatechange= myFoo; xmlhttp.open("GET",url,true); Here is my callback function: function myFoo() { if (xmlhttp.readyState==4) { if (xmlhttp.stat...

How to notify client about updated UpdatePanel content on server side

I have a problem with UpdatePanel.Update() which works initially but then stops. I have tumbled with this problem for some time and some background is needed so please read ahead. I have an ASP.net application in which I have a subpage that display computed information in graphs. Each graph is embedded in an UpdatePanel. The graph i...

jsTree async with preloaded data.

I am trying to make a tree view be async. When the page is rendered, there is default tree items displayed. jsTree tries to reload the root anyway. I want the page to render (with jsTree init'ed) with default items rendered from browser, not the ajax call. Then we the user tries to go deeper, thats when I want to do do the ajax calls. ...

How can I Submit client side answers (to a question) to the server using JAVA?

How can I Submit client side computer user's answers(to a multiple choice question) to the server using JAVA I have a centralized server and about 1000 client systems. In these 1000 systems students take multiple choice quiz at at time (in some 2 hrs time). Now i've to send all these answers of these questions to the server in an asyn...

updating an activity from an asynchronous service

I've implemented a service that does an asynchronous sync between my application and google docs. I want to update the top level activity of my application when the sync is complete. However because of the service it's possible that the app could be be in a unknown state. Is there a way to make the top level activity, whatever that ma...

How to detect a timeout when using asynchronous Socket.BeginReceive?

Writing an asynchronous Ping using Raw Sockets in F#, to enable parallel requests using as few threads as possible. Not using "System.Net.NetworkInformation.Ping", because it appears to allocate one thread per request. Am also interested in using F# async workflows. The synchronous version below correctly times out when the target hos...

Rx: Piecing together multiple IObservable web requests

Hello, I'm creating multiple asynchronous web requests using IObservables and reactive extensions. So this creates observable for "GET" web request: var tweetObservalue = from request in WebRequestExtensions.CreateWebRequest(outUrl + querystring, method) from response in request.GetResponseAsync()...

Understanding the Silverlight Dispatcher

I had a Invalid Cross Thread access issue, but a little research and I managed to fix it by using the Dispatcher. Now in my app I have objects with lazy loading. I'd make an Async call using WCF and as usual I use the Dispatcher to update my objects DataContext, however it didn't work for this scenario. I did however find a solution her...

C++ Winsock non-blocking/async UDP socket

Hi all! I'm developping a little data processor in c++ over UDP sockets, and have a thread (just one, and apart the sockets) that process the info received from them. My problem happens when i need to receive info from multiple clients in the socket at the same time. How could i do something like: Socket foo; /* init socket vars and ...

Why doesnt the AsyncCallback update my gridview?

Hi all, I started working with delegates last week and i am trying to update my gridview async on the background. All goes well, no errors or such but i dont get a result after my EndInvoke. does anyone know what i am doing wrong? Here is a code snippet: public delegate string WebServiceDelegate(DataKey key); protected void b...

C# Multithreaded Domain Design

Let's say i have a Domain Model that im trying to make compatible with multithreading. The prototype domain is a game domain that consists of Space, SpaceObject, and Location objects. A SpaceObject has the Move method and Asteroid and Ship extend this object with specific properties for the object (Ship has a name and Asteroid has a colo...