Questions tagged [task]

A task is an abstraction that is used to work with concurrency, it can denote operation that should be executed concurrently with the rest of a program. A task is a concurrent thread of execution in Ada and represents an asynchronous operation in .NET, also it corresponds to Threads in Java.

A task is an abstraction that is used to work with concurrency, it can denote operation that should be executed concurrently with the rest of a program.

  • Ada
    A task is a concurrent thread of execution in an Ada program. Task definitions are split into two parts - declaration and a body, which is mandatory. Task declaration defines entities exported from the task, whereas its body contains local declarations and statements of the task.

  • .NET
    Task is used to represents an asynchronous operation, it is a core concept of the which is used for asynchronous and parallel programming in the .NET framework.

  • C++
    future is used to represent an operation which may complete some time in the future. It helps programs achieve a degree of asynchrony where they may want/need to perform certain operations in parallel. std::async creates a task which may execute asynchronously, returning a std::future.

See also:

Related tags

8481 questions
3
votes
2 answers

Async task ASP.net HttpContext.Current.Items is empty - How do handle this?

We are running a very large web application in asp.net MVC .NET 4.0. Recently we had an audit done and the performance team says that there were a lot of null reference exceptions. So I started investigating it from the dumps and event viewer. My…
3
votes
2 answers

How to update ALL requests when a request property has changed, when using Async/Await?

I'm using async/await to make multiple requests per second to a service using their API. The problem I am running into is when I need to refresh the token (it expries every hour). After the token has expired, I get a 401 unauthorized error back from…
Prabhu
  • 12,995
  • 33
  • 127
  • 210
3
votes
1 answer

Celery: Structuring sequential tasks and getting the correct status

What is the best way to structure a bunch of sequential tasks using Celery? My code has a bunch of independent tasks (so they can all be immutable signatures), but I want to stop the sequence if one of the tasks throws an exception. I've been…
Paul Choi
  • 31
  • 4
3
votes
1 answer

How to archive files older than 7 days with creating one archive for all files with same date?

I am looking for someone who can help me make a scheduled task to automatically move log files into RAR archives. It does not have to be a batch file solution, if you have other ideas please share. I got the basic code for it. This is the batch file…
Metal Mike
  • 89
  • 4
  • 13
3
votes
1 answer

Cannot implicitly convert 'DataTable' to 'Task'

I am getting Error: Cannot implicitly convert type 'System.Data.DataTable' to 'System.Threading.Tasks.Task' The GetExternalMessage is taking Time to execute and hence the WinForm Stops responsing. Hence I thought of appling "Task Await". But…
Prateik
  • 241
  • 2
  • 6
  • 14
3
votes
1 answer

How to use await within Main

I have written a test app to help me understand await/async. I have a method MethodAsync1() which works fine. However when I call it from Main(), I cant figure out how to await for the MethodAsync1() to complete. See code below. class Program …
spiderplant0
  • 3,872
  • 12
  • 52
  • 91
3
votes
1 answer

Task with unhandled exception not tearing down while targetting .NET 4.0

According to http://blogs.msdn.com/b/pfxteam/archive/2009/05/31/9674669.aspx the tasks which have exceptions that are unhanded should tear down the application. However in Task unhandled exceptions the accepted answer states that in .NET 4.5 the…
Nickolay Kondratyev
  • 4,959
  • 4
  • 25
  • 43
3
votes
0 answers

JavaFX Pagination - Update the content of current page

In my JavaFX application I use Pagination to show some pictures. Reading the pictures takes much time so I fill an ObservableList with placeholder images, which should be replaced by the originals when they are loaded. Everything works fine,…
S.Pro
  • 633
  • 2
  • 12
  • 23
3
votes
2 answers

Communication between a thread and a task waiting

I am in this situation: many clients can send commands to a controller, and the controller must process each command in order, and send back a response to each client. The clients "awaits" for the response asynchronously. So, by now, when i receive…
MorgoZ
  • 2,012
  • 5
  • 27
  • 54
3
votes
1 answer

Queue a task for execution when all currently scheduled tasks finish - no references to the tasks

Is it possible to queue a new task for execution when all currently scheduled tasks have finished? I cannot use TaskFactory.ContinueWhenAll because I don't have references to the scheduled tasks as they are scheduled by subcomponents. Getting all…
Bartosz Wójtowicz
  • 1,321
  • 10
  • 18
3
votes
0 answers

Spawning a bunch of tasks at once, recursively, in OpenMP

What I'm trying to do is spawn N tasks at once, by recursively dividing the iteration space with the help of tasks, in order to spawn the 'real' tasks quicker. I can do this linearly with a loop, like so: for (int i = 0; i < N; i+=bx) #pragma omp…
Aleksr9
  • 1,233
  • 2
  • 9
  • 7
3
votes
1 answer

Is this equivalent to Task.Run?

I'm writing an F# application and I want to get rid of explicit references to task as much as possible. Is the following equivalent to Task.Run or am I missing something? [] module Async = let inline runInThreadPool…
N_A
  • 19,799
  • 4
  • 52
  • 98
3
votes
2 answers

Implementation of semaphore in Queues in freeRtos

Is queues in freeRtos from the beginning also mutual exclusive, by that i mean, shall i create some kind of mutual exclusion for writing or reading from a queue, or is it already implemented by the function xQueueRead and xQueueSend.
user3712774
  • 69
  • 1
  • 5
3
votes
1 answer

OpenMP 4.0 task dependencies of a pointer (OmpSs style)

I want to specify a #pragma omp task depend(...) clause on a variable reference through a pointer. This is possible in OmpSs and looks like: #pragma omp task in(*var1) out(*var2) Basically this is what I want to do in OpenMP 4.0, but the following…
Aleksr9
  • 1,233
  • 2
  • 9
  • 7
3
votes
1 answer

Schedule task in ASP.NET MVC 5

I am developing an ASP.NET MVC 5 application. I am using EF6 (Code First approach) to handle the data access and C#. I have the next scenarios: I have an Entity named Event with the following structure public class Entity{ public int Id{get;…
Evan
  • 115
  • 1
  • 11
1 2 3
99
100