15 votes
Accepted

A new approach to multithreading in Excel

Interesting idea and well-done! Naming I really don't like the names. The names like clsMultiThread is somewhat misleading, since as you noted they don't actually ...
this's user avatar
  • 2,019
14 votes
Accepted

Asynchronous TCP server

This is an ugly old pattern. Why don't just try the newer async/await? You already use Task in your tests anyway. In order to ...
t3chb0t's user avatar
  • 44.1k
13 votes
Accepted

Implementing an asynchronous mutex in C#

A better alternative to the busy wait loop would be to use a Semaphore - in this case a SemaphoreSlim would probably be the most appropriate. Semaphores are not ...
ChrisWue's user avatar
  • 20.3k
12 votes
Accepted

Calling synchronous code in asynchronous method

If it's really just removing an item from a dictionary (and not e.g. doing synchronous file IO), then Alternative 1 is the best. When you're using async for scalability (e.g. in ASP.NET), using ...
svick's user avatar
  • 24.2k
10 votes
Accepted

Generic asynchronous SQLite search builder

Reflection is slow. That line probably doesn't help your performance : var model = (T)Activator.CreateInstance(typeof(T)); I notice that you always create your ...
IEatBagels's user avatar
  • 12.4k
10 votes

Asynchronous Circular Buffer in C#

Quick Review An API like this, dealing with thread-sensitive operations, requires time and effort to test and review rigorously. When I will find this time, I will do a thorough review. But here are ...
dfhwze's user avatar
  • 13.9k
8 votes

C++: algorithm that uses fixed-size buffer of data that are produced in stream, faster than the algorithm speed

Separate the data structure from the workers The class CSyncAlgo is doing way too much, making it harder to understand, and making it less flexible. I would start ...
G. Sliepen's user avatar
  • 50.4k
7 votes
Accepted

Synchronous / asynchronous REST client

In call(), you have duplicate code: ...
TheCoffeeCup's user avatar
  • 9,454
7 votes
Accepted

Closing SQL connection for async operations

No that isn't right. If your query throws an error you won't be closing the connection. Swallowing exceptions like that (even though you're logging it) is generally bad as well. How does the user know ...
RobH's user avatar
  • 16.9k
7 votes
Accepted

Login UI for an Android app

Using an AsyncTask instead would be much better. You've got many callbacks to the UI thread, all of this you could do in the post execute method instead: ...
Aritz's user avatar
  • 355
7 votes
Accepted

WPF Mvvm async function ViewModel

General Your model should not return an ObservableCollection because that collection should be used only if its change notification ability is needed (e.g. with ...
JanDotNet's user avatar
  • 8,538
7 votes
Accepted

Using SendAsync to send multiple emails

From the SendAsync docs: After calling SendAsync, you must wait for the e-mail transmission to complete before attempting to send another e-mail message using Send or SendAsync. So no, this ...
RubberDuck's user avatar
  • 30.8k
7 votes

A new approach to multithreading in Excel

This is way above my expertise, but maybe adding an answer would cause more views/answers? Also, what's that beginner tag doing there? ;) I want to say first off, really solid work. That's probably ...
Raystafarian's user avatar
  • 7,149
7 votes
Accepted

Async friendly Timer

The API would really benefit from some inline documentation (///), but mostly looks good. Threading I'm no expert but it looks fine to me. The only thing that is ...
VisualMelon's user avatar
  • 7,421
7 votes

Monitor asynchronous tasks, tracking their running times

Ugly typedef I'm not a big fan of this: typedef std::future<int> FutureResultInt; It's not significantly shorter or easier to read, it doesn't isolate the ...
Toby Speight's user avatar
7 votes
Accepted

C# asynchronous notification vector

I don't think that screen space is so limited that methods can't be separated by a blank line, and separation makes it slightly easier to see scope. ...
Peter Taylor's user avatar
  • 24.1k
7 votes

Action queue manager to perform action in a FIFO fashion

EnqueueAction may want to throw an ObjectDisposedException if the queue is disposed, depending on the precise API you want. I ...
VisualMelon's user avatar
  • 7,421
6 votes

Synchronous / asynchronous REST client

On every getAsyncData call you create new DataFetcherTask with private ExecutorService executorService = Executors.newFixedThreadPool(10); (why 10?) then create ...
dezhik's user avatar
  • 161
6 votes

Calculating pi by adding areas of thin rectangles

I see a number of things that could help you improve your program. Don't abuse using namespace std Putting using namespace std ...
Edward's user avatar
  • 65.3k
6 votes
Accepted

HTTP downloader using Beast

Missing Headers Before going any further, the current code is missing a few headers that it needs, namely: <functional> and ...
D. Jurcau's user avatar
  • 3,010
6 votes
Accepted

C++ Wrapper for cURL: Multithreading and serializing asynchronous ops

Design Issue Creating a new thread for every connection is not a good idea. Creating a thread is expensive. Also a single thread can easily handle thousands of connections, so utilizing a single ...
Martin York's user avatar
  • 94.3k
6 votes
Accepted

Implementation of Asynchronous Cache

The way your code is today this should work fine. But if you ever decide to add a RemoveItem method you can have issues. Since you are checking if the key exist ...
CharlesNRice's user avatar
  • 4,313
6 votes
Accepted

Wordcloud from all answers of a user here on CR

Quick bits You have some issues that some linters would pick up: I would suggest moving your main code into a function. So that it doesn't pollute the global namespace. You've got some trailing ...
Peilonrayz's user avatar
  • 42.7k
5 votes
Accepted

MVC Async Action Invoking Workflow

I cannot believe this went unanswered for 5 and a half years (I guess I can, it is a difficult question to answer) - I'm going to try to answer it from the respect of early 2012, and the respect of ...
Der Kommissar's user avatar
5 votes
Accepted

Producer/consumer implementation using Tasks and BlockingCollections

Did you know that Task.Result blocks? Your code isn't asynchronous at all - and it can't be unless DoRead is. Effectively your ...
RobH's user avatar
  • 16.9k
5 votes

Synchronous / asynchronous REST client

CompletionService Your call() method can be simplified by using a CompletionService. This allows the code to complete in a ...
rolfl's user avatar
  • 97.3k
5 votes
Accepted

Async telnet connection over StreamSocket

I see at least two points. if you have a catch to catch a sytem Exception (wich is not good btw., it would be better to catch ...
Heslacher's user avatar
  • 50.3k
5 votes

Execute coroutines in pool

Making a pool of coroutines does not seem to be the way why we invented coroutines. Coroutines are meant to be lightweight, so that they can be created in very large numbers. Rather than limiting the ...
ospider's user avatar
  • 169
5 votes
Accepted

Spawning futures as an alternative to multithreading

I see some things that may help you improve your code. Simplify your code using literals There is nothing intrinsically wrong with std::chrono::milliseconds(0) ...
Edward's user avatar
  • 65.3k
5 votes
Accepted

TryRetry - Try, Catch, then Retry

I see 2 little issues with RetryLoop method. First, you check maxTries for an invalid negative value but I think that a 0 value ...
Rick Davin's user avatar
  • 6,227

Only top scored, non community-wiki answers of a minimum length are eligible