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 ...
11
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
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
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
Javascript progress bar in succession
Your code already looks pretty clean. Good work! There are only a few things I would recommend changing.
Don't define timings in CSS that should be defined in JavaScript. In this specific case using ...
5
votes
Accepted
Retry cancelled tasks
Task is a reference type, so your copy will always be the same initial task, and when it is cancelled it will stay cancelled forever - see Restart a completed task.
You can use Func instead of a Task ...
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
Upload a file asynchronously
Seems a bit needlessly complicated and not exactly async at all. You're just forcing an async call to be synchronous with .Wait(). Proper way is to use async "all ...
5
votes
Accepted
Python: Asyncio object-oriented style
Old style declaration
class Limiter(object):
...
Using object as a base class is no longer necessary. Simply write:
<...
5
votes
Send multiple REST requests at the same time. (node)
When you have multiple asynchronous requests to make, and you want them to operate in parallel, usually the appropriate tool to use is Promise.all. You can use it ...
5
votes
Accepted
Send multiple REST requests at the same time. (node)
Your code boils down to just executing getGroups() in parallel with the getProfile()-...
5
votes
Accepted
Executing method with time limit restrictions
I did a little bit of cleanup. The CancellationTokenSource can take a TimeSpan, which you have in hand. Note also that it is an <...
4
votes
Accepted
Are there pitfalls to this solution to read messages from a queue in parallel?
Readability
Use keyword var any time that the initialization of the variable clearly tells what the variable represents. Avoid abbreviations in variable names.
<...
4
votes
Accepted
Returning the results of four $resource calls as a JSON array in AngularJS
Never, and I mean NEVER, manually construct JSON. That's just asking for trouble. Construct the object then use JSON.stringify. FYI, arrays are valid JSON so you ...
4
votes
Nested loop with synchronous and asynchronous behavior
First you can make the database container more precise and accessible if you define it like this:
...
4
votes
Accepted
SemaphoreSlim limit tasks
It seems you simply need process a fixed set of work items in parallel with a fixed degree of parallelism and in an async compatible way. Stephen Toub has written a very elegant way to do that in just ...
4
votes
4
votes
Accepted
Fetching user details, posts, and comments using promises in ExpressJS
If you use 1 promise, you would encounter a long chain of then method and all of async operations would be executed in sequence style which increases response time.
If you create 3 promises, all of ...
4
votes
Asynchronous File System Abstraction
Use an existing filesystem library
You probably want to use the C++17 filesystem library. It is very close to what you have posted here. If you cannot use C++17, then use the Boost Fileystem library, ...
4
votes
Accepted
Scraping urls asynchronous including exception handling
tasks = []
while urls:
tasks.append(fetch(session, urls.pop()))
can be largely simplified to
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
asynchronous × 511c# × 181
javascript × 106
async-await × 68
python × 59
java × 56
multithreading × 48
c++ × 42
node.js × 42
promise × 32
python-3.x × 29
.net × 28
android × 24
http × 23
task-parallel-library × 22
error-handling × 20
concurrency × 20
socket × 20
performance × 19
thread-safety × 18
callback × 14
beginner × 13
jquery × 12
swift × 11
queue × 11