asynchronous

Good F# Asynchronous IO Sample

Hi, Where can I find a good sample of Asynchronous IO on files with thread hooping? Thanks ...

Future.get() and InterruptedException Asynchronous threading

Im using asynchronous threading in my application WITH httpClient. I make a call using the Future Api like so mStrResults = (String) rssFuture.get(); this call attempts to retrieve an html string returned from my Callable httpClient call() method. What i want to do however is ensure that the get method does not wait too long while ...

Changing async call implementation using a ManualResetEvent to one using a combination of Thread methods

I'm looking for a design pattern to switch from using a ManualResetEvent to using Thread methods like Thread.Join. Right now I'm making an async call and then using a ManualResetEvent to wait till the async call finishes before continuing on the thread that made the call. I'd be glad for any implementation that would produce more stable...

Dealing with variable assignments and async requests

I'm looking for a reliable design for handling assignments that have asynchronous requests involved. To further clarify, I have a class which handles Data Management. It is a singleton and contains a lot of top level data for me which is used throughout my iPhone application. A view controller might do something such as the following: ...

Idiomatic asynchronous design

Are there any sorts of useful idioms I can make use of when writing an API that is asynchronous? I would like to standardize on something as I seem to be using a few different styles throughout. It seems hard to make asynchronous code simple; I suppose this is because asynchronous operations are anything but. At the most basic level, th...

Ajax Asynchronous in IE - Error "The Data Necessary to Complete This Operation is Not Yet Available"

Hey there. I have a 100% valid Ajax model written in Javascript with a few inputs I use being, Get or Post method, What page to communicate with, What String to send to that page and What element on my own page I might be fiddling with when I receive my response. The problem is that, should I set the request to Asynchronous (Hence Ajax),...

Why asynchronous ASHX generated images doesn't always work in IE6?

If you use an WebHandler inheriting IHttpAsyncHandler, you shouldn't notice that under undetermined specific circumstances the browser MS IE6 won't display it, the request will never finish. Is there a fix for it? ...

Is .NET System.Net.CookieContainer thread safe?

Is the .NET class System.Net.CookieContainer thread safe? --Update: Turnkey answered-- Is there any way to ensure thread safeness to variables which are modified during asynchronous requests (ie. HttpWebRequest.CookieContainer)? Is there any attribute to highlight thread safe classes? --Update: If thread-safeness is described on MSDN th...

How to dispose asynchronously?

Let's say I have a class that implements the IDisposable interface. Something like this: MyClass uses some unmanaged resources, hence the Dispose() method from IDisposable releases those resources. MyClass should be used like this: using ( MyClass myClass = new MyClass() ) { myClass.DoSomething(); } Now, I want to implement a...

asynchronous select db2

Does db2 support asynchronous SQL operations? I.e. if I execute a select stmt on a table which has 20M rows and I expect back 5M rows. When I run this query via JDBC, I want the control to be returned immediately while the db is executing the query and populating the ResultSet asynchronously in the backend thread. I know some dbs like S...

Detecting that a ThreadPool WorkItem has completed/waiting for completion

For whatever reason, ThreadPool's QueueWorkItem doesn't return an IAsyncResult or some other handle to the work item, which would allow to wait until it's completed. There are RegisterWait... methods, but you have to pass a WaitHandle and creating them is expensive (see IAsyncResult documentation, which advises you to delay creating a Wa...

Implementing IAsyncResult explicitly

I am generally wary of implementing interfaces partially. However, IAsyncResult is a bit of a special case, given that it supports several quite different usage patterns. How often do you use/see used the AsyncState/AsyncCallback pattern, as opposed to just calling EndInvoke, using AsyncWaitHandle, or polling IsCompleted (yuck)? Related...

Calling SSIS package Asynchronously

Hi, I'm calling a SSIS package using LoadPackage(...). Is it possible to make this call an Asynchronous call? ...

Using BeginInvoke/EndInvoke in a multithreaded fashion. How do AsyncCallback, AsyncWaitHandle and IsCompleted interact?

Andreas Huber's answer to this question gave me an idea to implement Concurrent<T> with async delegates instead of the ThreadPool. However, I am finding it harder to understand what's going on when an AsyncCallback is passed to BeginInvoke, especially when several threads have access to IAsyncResult. Unfortunately, this case doesn't seem...

Windows Explorer's Busy cursors and give-up copy operations - why?

Can anyone please enlighten me as to why windows explorer is so, well, synchronous. Why are there so many operations that cause busy cursors. Also, can anyone understand why directory-copy needs to be as broken as it is, after all these years, can't something be done?! If I copy a directory and there's a file in that directory being lo...

Busy cursors - why?

Can anyone give me a scenario where they think busy cursors are justified? I feel like they're always a bad idea from a user's perspective. Clarification: by busy cursors, I mean when the user can no longer interact with the application, they can only move their hourglass mouse pointer around and whistle a tune. ...

socket.shutdown vs socket.close

I recently saw a bit of code that looked like this (with sock being a socket object of course): sock.shutdown(socket.SHUT_RDWR) sock.close() What exactly is the purpose of calling shutdown on the socket and then closing it? If it makes a difference, this socket is being used for non-blocking IO. ...

How to show asynchronous operations on UML Activity diagram

I am about to draw/document for some client-server connection establishing code to better understand it. There are several operations that are done asynchronously in separate threads (connecting threads, data receiving threads, etc). Should I show them on separate diagrams? I would prefer to have it on a single diagram to grasp overall ...

Does the Garbage Collector destroy temporarily unreferenced objects during async calls in .NET?

Imagine that I will make an async call in .NET, i.e. HttpWebRequest.BeginGetResponse, and the HttpWebRequest object isn't referenced at a broader scope. Will the Garbage Collector destroy it and cause problems? Example code: using System; using System.Net; public class AsyncHttpWebRequest { void Main() { var Request = ...

What's the best way of ensuring valid object lifespan when using Boost.Asio?

Hi all. Been playing a lot with Boost.Asio of late. I like the library a lot since it offers a fantastic way to squeeze performance out of today's multicore systems. A question I have asked myself a few times, and I thought worth throwing out there regards object lifespan / ownership when making async calls with Asio. The problem I'v...