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

Mark task as completed

I’m implementing a client protocol MyProtocol over TCP/IP. The protocol’s Connect() method should have a signature similar to that of TcpClient.ConnectAsync() – that is, it should return a Task: Task MyProtocol.Connect (…); This method…
alexk
  • 143
  • 1
  • 11
3
votes
1 answer

Does await Task.Delay; really enable web server to process more simultaneous requests?

From Pro Asynchrnous Programming with .Net: for (int nTry = 0; nTry < 3; nTry++) { try { AttemptOperation(); break; } catch (OperationFailedException) { } Thread.Sleep(2000); …
bckpwrld
  • 1,159
  • 1
  • 11
  • 23
3
votes
1 answer

OpenMP tasks & data environment

I'm trying to use a task construct for my C++/OpenMP program: #pragma omp parallel { typename ClusterNormal::VectorMean ResultMeanThread; ResultMeanThread.setZero(); #pragma omp single for(list
Darko
  • 1,448
  • 4
  • 27
  • 44
3
votes
1 answer

Passing value parameter to Task in c#

I have an issue with passing a long by value to a Task. I have a list of ID's where I loop through each one, assign to a local variable then pass as a parameter to a new Task. I do not wait for the task to complete before looping round and…
user910643
  • 43
  • 2
  • 8
3
votes
1 answer

OpenMP Task Scheduling Policies

I would like to know how the task scheduling of the OpenMP task queue is performed. Here I read that, by default, OpenMP imposes a breadth-first scheduler and that they did some tests FIFO vs. LIFO, but they don't say anything about the default.…
fc67
  • 409
  • 5
  • 17
3
votes
4 answers

How to add hbm2java task to Ant in NetBeans

I'm trying to generate POJO's from mapping xml files. I read something about adding an ant task, to do it easily. I've added this xml below to my project's build-impl.xml in Netbeans, but nothing happens:
Janov Byrnisson
  • 255
  • 1
  • 3
  • 9
3
votes
4 answers

How to know an Android task's visibility change?

I have 2 activities which are using the same Android task - i.e. they will use the same back stack. Let's call A the first activity in the back stack, and B the second activity in the back stack. case 1: A is notified that it goes in the background…
Vincent Cantin
  • 16,192
  • 2
  • 35
  • 57
3
votes
1 answer

Why can't see all task when use 'tasks' task in Gradle?

task startSession << { chant() } def chant() { ant.echo(message: 'Repeat after me...') } 3.times { task "yayGradle$it" << { println 'Gradle rocks' } } yayGradle0.dependsOn startSession yayGradle2.dependsOn yayGradle1, yayGradle0 task…
Xelian
  • 16,680
  • 25
  • 99
  • 152
3
votes
2 answers

Gradle Error while instrumenting class

I’m working on a POC with Jacoco and gradle for GigaProject and am getting this error when it gets to jacoco during "test" task aka instrumenting test source code. Any ideas? Thanks. java.lang.instrument.IllegalClassFormatException: Error while…
AKS
  • 16,482
  • 43
  • 166
  • 258
3
votes
1 answer

How to wrap 3rdParty function with callback to be able to wait for the callback finish and then return a result from callback function?

I want to wrap 3rd party function to Task to be able to await for finish the callback function. This is what I would like to achieve: public MyClass MyProperty { get { if (myProperty == null) myProperty =…
bendi
  • 133
  • 1
  • 6
3
votes
2 answers

About the Task.StartNew(Action, Object) method
I'm learning the TPL on this page, and one code block confuses me a lot. I was reading this page: Task Parallelism (Task Parallel Library) in one section, it said that the following code is the right solution because a lambda in a loop can't get the…
Albert Gao
  • 3,653
  • 6
  • 40
  • 69
3
votes
2 answers

Catching the original exception with TransformBlock

I am using the TransformBlock from the TPL Dataflow library, and I have realized that when a exception is thrown during the transform, I get a generic exception in the "Receive" method, but no mention to the original one. In this code: Func
vtortola
  • 34,709
  • 29
  • 161
  • 263
3
votes
2 answers

ThrowUnobservedTaskExceptions not working

I have created a test application in Winform to learn exception handling in Task (c#). Target framework is 4.0. Following is my code for exception handling var task = Task.Factory.StartNew(() => getDataTable(Convert.ToInt32 …
Anirban Paul
  • 1,065
  • 1
  • 16
  • 22
3
votes
3 answers

ThreadAbortException with await

I'm facing a weird bug. I have something like 100 long running tasks and I want to run 10 of them in the same time. I found something very similar to my need here : http://msdn.microsoft.com/en-us/library/hh873173%28v=vs.110%29.aspx in the…
3
votes
2 answers

Explanation on Tasks

I'd like some clarification on code I didn't do and have to modify in a service. Here's some parts of the code of the service private Thread _thread; private ConcurrentQueue _tasks = new ConcurrentQueue(); private Task _runningTask =…
Shadowxvii
  • 1,080
  • 2
  • 12
  • 31
1 2 3
99
100