8,655 questions
0
votes
1
answer
75
views
I have three query able items when I call To List Async Method I face the following error in EF core
Hello I have three queries which I fetched from repository and in application layer I convert the query to List.
Below is my code:
private async Task<Tuple<List<GetCustomerDto>, List<...
0
votes
0
answers
58
views
How to update object that stored in memory from multiple tasks in .NET Core
I am storing object in memory via Distributed Memory Cache and access it from different background services and controllers.
There are two services that reading the object from memory by its key id ...
-1
votes
1
answer
109
views
How to process multiple files with multi-threads?
What I meant was
If there are 100 files, 100 threads will be created to read the file and process the contents of the file,
When there are 100 files, one thread is turned every second, and no threads ...
0
votes
2
answers
814
views
Ignore task exception in ContinueWith
I want to suppress exception triggered in the task. As I recall, some time ago I used this code to make it possible:
void Main(..)
{
Task Fail()
{
throw new Exception("ex");
...
1
vote
0
answers
687
views
How to see if a FreeRTOS task has been deleted
Note: this is a horrible design pattern, and ephemeral FreeRTOS tasks should not be created. I acknowledge this in my attempt at writing a FreeRTOS best practices guide, bullet #17 here:
[SAFETY-...
-1
votes
2
answers
150
views
Nested asynchronous tasks in .NET
I'm writing a script for extending one of my datasets of email data with some features that I have to compute by calling external APIs. I have to use C#, which is not a language I'm very confident ...
1
vote
0
answers
173
views
ECS - fargate task fails and starts for no reason
my cpu and memory utilization hasn't atlest reched 50% and we didn't change any configuration from our side.
My image and task definition is also not disturbed BUT MY TASK GOT STOPPED AND RESTARTED ...
0
votes
1
answer
1k
views
Why does my C# .net 8 program, with an await operator, using a task, tell me that I do not have a await operator?
This code is trying to get details of a Complex Type Value.
I am using a task with await. However, I still get a warning that the await operator does
not exist.
I am not sure where I have gone wrong ...
0
votes
0
answers
345
views
Celery not registering tasks
My current program setup consists of a run.py file with the following contents:
from cocapi.task import my_add
from cocapi import app
print(app.tasks.keys())
res = my_add.delay(1, 2)
print(res.get())...
0
votes
0
answers
540
views
ASP.NET Request timeouts middleware, how to cancel any endpoint action after timeout expired
I have asp.net web api with controller's methods witch not implement cancellation token, for example:
[HttpGet(nameof(Get))]
public async Task<UserDto> Get([FromQuery] Guid userId) => await ...
0
votes
1
answer
115
views
The behavior of Task seems to differ in Playground environments
In an actual app project, when running the following code, the print statements occur in the order of 1->3->2:
var body: some View {
Text
.onAppear {
print("1")
...
0
votes
1
answer
164
views
ECS fargete TASK fails when service is created and after some tasks getting failed task is running and reaches a stady state
Im using ECS FARGATE, ALB, Target Group with instyance ip.
when ever my service creates a task it is getting the following error and task is getting failed.
New task is being created after this issue ...
-1
votes
1
answer
822
views
Using Task.Delay in synchronous method results in high memory consumption [closed]
I know that what am about to show is wrong, but I want to know what exactly is going on. I can not attach images because of my low reputation.
I have .NET 7 API project.
I use Task.Delay() in sync ...
0
votes
0
answers
56
views
How to calculate monthly instalment specifed in task in maxima?
I am stuck trying to make a solution for a task my tutor asked me to do using wxMaxima.
Here's the task:
"On June 1, you take a mortgage that is repaid in fixed monthly instalments for 10 years ...
1
vote
1
answer
484
views
Concurrency problem when only parts of a class are annotated with @MainActor
I have set Strict Concurrency Checking to Complete, and the following code compiles without warnings in Xcode 15.0.1 and Xcode 15.1 beta 3.
When running it, it shows a concurrency problem. The inc() ...
2
votes
1
answer
107
views
Problem with subtype usage in concurrent Ada program
I am working on a concurrent programming problem in Ada. The task is to simulate a bridge over which different cars can pass from different directions. The complication lies in the fact that, if an ...
0
votes
0
answers
89
views
Parallel.ForEach + missing records [duplicate]
I have the below function which does a set of tasks:
private async Task DoworkAsync(List<OrderFragment> of)
{
var sw = Stopwatch.StartNew();
var task = CreateOrderjson(of);
await ...
0
votes
1
answer
225
views
Routine to perform actions in Tasks, showing a loading screen, without freezing the main form
I'm looking to build a routine that is responsible for executing any action via procedure (Tproc) using Tasks, while displaying a loading screen, without freezing the system's main form. An extra ...
2
votes
1
answer
787
views
Awaiting foreign tasks - warning VSTHRD003
Lets say I have a startable class that have StartAsync and StopAsync. When StopAsync is called the method wait until all necessary tasks are finished and handled properly. (Writing some things to db ...
0
votes
1
answer
128
views
How to generalize async methods with delegate parameters in C# to reduce redundant code?
I have some async methods I want to try a set number of times until they return true or the max attempts have been reached, with a delay in between. I've been able to get the outcome I desire, but ...
0
votes
1
answer
101
views
Waiting for all tasks to complete in Threadpool
I need help with this code, so if anyone is willing to help I would be grateful.
I'm working on developing a simple thread pool, which is passed an array of numbers, and the threads compute the ...
-2
votes
1
answer
477
views
Locking behaviour when dealing with async/await [closed]
I might be overthinking this, but I'm not sure I understand how locking works when dealing with await/async.
Given the following, after each await a different thread can return to execute the next bit ...
1
vote
0
answers
292
views
Can and should I use JS AbortController like .NET CancellationToken?
I recently found out about AbortController and its sibling AbortSignal to register event listeners until I don't want it anymore.
When I look at the documentation, it looks surprisingly similar to ....
2
votes
2
answers
415
views
Strange deadlock while sync with TaskCompletionSource and AutoResetEvent
While running the following C# program, I randomly got two different results.
Result 1 (occurred frequently) is actually deadlocked. Please explain to me why this happened.
I am not expecting the ...
1
vote
1
answer
148
views
Implementing Tasks, await and async for background work
I am new to Tasks and its associated keywords in C#. My goal is to setup a background thread/task that will continuously poll a server every n seconds. Using the .NET TPL library, is the following ...