14
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 ...
13
votes
Accepted
Simple Async Google Maps initializer with AngularJS
I like it,
you could clean up the commented out code and possibly replace
$window.googleMapsInitialized = function () {
mapsDefer.resolve();
};
...
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 ...
13
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 ...
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 ...
11
votes
Script to enter text in a box
Rather than using System Events to generate keystrokes, consider using TextEdit itself to insert text.
...
11
votes
Accepted
A ViewModel using ReactiveUI 6 that loads and sends data
Sorry to disappoint, but you did everything right! This is a quite good example of using RxUI, Akavache, and Refit together.
The only thing I would change, is to not immediately call ...
10
votes
Accepted
Running 2 sets of tasks at the same time
When I have to manage multiple threads, I make sure all processing is complete, typically by using WaitAll.
...
10
votes
Accepted
Running Code Just Once
There are a few items to make this code better.
Naming. Once is an OK name for the class, but the method name IsDone is a problem. This is an 'atomic' operation ...
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 ...
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 ...
8
votes
Accepted
Non-blocking, non-threaded HTTP client implementation
Have you considered using HttpClient class from .Net 4.5+? That makes your code lot cleaner.
Also why not take Async pattern all the way? From your initiator (button click or main etc) you can call ...
7
votes
Accepted
Verifying the type of an AggregateException's inner exception in a unit test
I am blocking the call using AsTask().Result, is this the most appropriate method?
Can't you use await? Most testing frameworks ...
7
votes
Script to enter text in a box
Assuming that you want to stick with the original plan to insert text wherever the cursor happens to be, you would need something more deterministic than an arbitrary delay.
This script covers all ...
7
votes
Accepted
Asynchronous method and collection binding
First, I want to point out the behavior of method that is declared as async void. When the code reaches this line:
...
7
votes
Accepted
Asynchronous HTTP JSON request
I know this is technically outside the scope of the review here, but your first parameter's type is Method. This enum desperately needs to be renamed. When I see <...
7
votes
Accepted
Getting messages asynchronously using MailKit
It's hard to say how to write the ideal method for your use-case because you don't specify some of the details that would be necessary to know, such as:
How often will your code be making this query?
...
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 ...
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:
...
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 ...
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 ...
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 ...
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 ...
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.
...
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 ...
6
votes
Calling many web services asynchronously
I'm not all that familiar with async/await (I really need to get going on this), but I find your code pretty clear, except why ...
6
votes
Calling many web services asynchronously
SemaphoreSlim implements IDisposable and should be disposed of, preferably using the using ...
6
votes
Calling many web services asynchronously
The fact that the lambda you're passing to Task.Run is async, along with the comment, implies that the work being done is not ...
6
votes
Accepted
First time trying async
There isn't much to review here, but I would probably have introduced a variable for the awaited call's result, and then used a ternary to determine the ...
6
votes
First time trying async
you should make use of newlines and the fact that C# is semi-colon terminated right here
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
asynchronous × 528c# × 187
javascript × 121
async-await × 75
python × 65
java × 55
node.js × 48
multithreading × 46
promise × 34
c++ × 33
python-3.x × 31
.net × 29
android × 26
http × 25
socket × 23
performance × 21
task-parallel-library × 21
error-handling × 20
concurrency × 19
beginner × 18
thread-safety × 18
callback × 16
jquery × 12
web-scraping × 12
c++11 × 11