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 ...
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 ...
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 ...
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 ...
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
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 ...
7
votes
Accepted
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
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 ...
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
Synchronous / asynchronous REST client
On every getAsyncData call you create new DataFetcherTask with
private ExecutorService executorService = Executors.newFixedThreadPool(10);
(why 10?) then create ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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) ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
asynchronous × 524c# × 185
javascript × 114
async-await × 74
python × 62
java × 53
multithreading × 51
node.js × 43
c++ × 41
promise × 34
python-3.x × 30
.net × 30
http × 24
android × 23
task-parallel-library × 22
thread-safety × 21
socket × 21
performance × 20
error-handling × 20
concurrency × 20
beginner × 15
callback × 15
jquery × 12
swift × 12
queue × 12