# \#task

**URL:** https://discourse.julialang.org/tag/task/349.md?page=1

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

**Page:** 2

---

## [Number of threads, puzzle](https://discourse.julialang.org/t/number-of-threads-puzzle/74965)

<div class="topic-metadata">

**Author:** [@HANHAOHAN](https://discourse.julialang.org/u/HANHAOHAN)\
**Replies:** 9\
**Last updated:** [February 2, 2022, 10:06pm UTC](https://discourse.julialang.org/t/number-of-threads-puzzle/74965 "2022-02-02T22:06:50Z")

</div>

draft.jl c1 = Channel(100) c2 = Channel(100) c3 = Channel(100) function task\_1() while true wait(c1) take!(c1) end end function task\_2() while true wait(c2) take!(c2) end…

---

## [Julia 1.7 says it can switch the thread your task is on. How often does that happen, and how can it be disabled?](https://discourse.julialang.org/t/julia-1-7-says-it-can-switch-the-thread-your-task-is-on-how-often-does-that-happen-and-how-can-it-be-disabled/75373)

<div class="topic-metadata">

**Author:** [@heyx3](https://discourse.julialang.org/u/heyx3)\
**Replies:** 6\
**Last updated:** [January 28, 2022, 5:01pm UTC](https://discourse.julialang.org/t/julia-1-7-says-it-can-switch-the-thread-your-task-is-on-how-often-does-that-happen-and-how-can-it-be-disabled/75373 "2022-01-28T17:01:19Z")

</div>

According to the release notes: Tasks can now migrate among threads when they are re-scheduled. Previously, a Task would always run on whichever thread executed it first Does this mean that the thread I’m running on …

---

## [Using Makie with Threads.@spawn](https://discourse.julialang.org/t/using-makie-with-threads-spawn/54618)

<div class="topic-metadata">

**Author:** [@tt1234567](https://discourse.julialang.org/u/tt1234567)\
**Replies:** 12\
**Last updated:** [January 23, 2022, 2:00pm UTC](https://discourse.julialang.org/t/using-makie-with-threads-spawn/54618 "2022-01-23T14:00:38Z")

</div>

I’d like to plot a stream of data in a separate thread. Using Makie works up to a point, but the axis labels seem to come out wrong and it occasionally crashes. I don’t know if I’m doing something wrong or if it’s a limi…

---

## [Threads.@spawn can not run many time?](https://discourse.julialang.org/t/threads-spawn-can-not-run-many-time/71765)

<div class="topic-metadata">

**Author:** [@HANHAOHAN](https://discourse.julialang.org/u/HANHAOHAN)\
**Replies:** 5\
**Last updated:** [January 12, 2022, 6:36am UTC](https://discourse.julialang.org/t/threads-spawn-can-not-run-many-time/71765 "2022-01-12T06:36:24Z")

</div>

HELP!!! code as following: cmid = Channel(100) while true wait(cmid) (mid::UInt32, video\_name::String) = take!(cmid) append!(mid\_list, fetch\_from\_list!(tasklist)) t = Threads.@spawn get\_frmkb(mid, video…

---

## [Task not runnable error](https://discourse.julialang.org/t/task-not-runnable-error/73506)

<div class="topic-metadata">

**Author:** [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Replies:** 3\
**Last updated:** [December 23, 2021, 1:38am UTC](https://discourse.julialang.org/t/task-not-runnable-error/73506 "2021-12-23T01:38:37Z")

</div>

Hi folks, I have a task that says it’s runnable, but I get a task not runnable error: julia\> task = @task readline(stdin) Task (runnable) @0x000000010f798010 julia\> yield(task) julia\> task Task (runnable) @0x000000010…

---

## ["kill" internal execution](https://discourse.julialang.org/t/kill-internal-execution/73144)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 4\
**Last updated:** [December 15, 2021, 6:59pm UTC](https://discourse.julialang.org/t/kill-internal-execution/73144 "2021-12-15T18:59:15Z")

</div>

Is it possible to “kill” the execution of a function under some condition? The use case here would be for benchmarking. That is, I want to run several benchmarks, but I don’t want any of them to take more than some ammo…

---

## [Use of Channels (or similar) constructs in parallel processing](https://discourse.julialang.org/t/use-of-channels-or-similar-constructs-in-parallel-processing/18497)

<div class="topic-metadata">

**Author:** [@hesham](https://discourse.julialang.org/u/hesham)\
**Replies:** 4\
**Last updated:** [December 11, 2021, 8:26am UTC](https://discourse.julialang.org/t/use-of-channels-or-similar-constructs-in-parallel-processing/18497 "2021-12-11T08:26:23Z")

</div>

Hi, I have used Julia Channels in real-time processing of data in a pipeline fashion. Each Channel passes data to the next processing step. A simplified example is the code below, one channel for generating random numbe…

---

## [@sync is not working](https://discourse.julialang.org/t/sync-is-not-working/70846)

<div class="topic-metadata">

**Author:** [@benibilme](https://discourse.julialang.org/u/benibilme)\
**Replies:** 5\
**Last updated:** [November 21, 2021, 8:40pm UTC](https://discourse.julialang.org/t/sync-is-not-working/70846 "2021-11-21T20:40:44Z")

</div>

Hello, I am newbie in Julia. I am writing a small program which reads topics/records from Apache Kafka, process it and writes as another topic back. My main function which is in main.jl file is as follows. There are b…

---

## [Create multiple tasks in a loop](https://discourse.julialang.org/t/create-multiple-tasks-in-a-loop/71701)

<div class="topic-metadata">

**Author:** [@Bossax](https://discourse.julialang.org/u/Bossax)\
**Replies:** 5\
**Last updated:** [November 19, 2021, 7:54pm UTC](https://discourse.julialang.org/t/create-multiple-tasks-in-a-loop/71701 "2021-11-19T19:54:18Z")

</div>

Hi everyone, I am trying to create multiple tasks in a forr loop using @eval. Here is a block of code f(k) = begin sleep(1) println("t$k is done") end begin for k in 1:4 @eval $(Symbol(:t,k)) = @tas…

---

## [Print on a separate Blink window, or elsewhere than STOUT](https://discourse.julialang.org/t/print-on-a-separate-blink-window-or-elsewhere-than-stout/37014)

<div class="topic-metadata">

**Author:** [@Dario\_Sarra](https://discourse.julialang.org/u/Dario_Sarra)\
**Replies:** 0\
**Last updated:** [April 4, 2020, 12:07pm UTC](https://discourse.julialang.org/t/print-on-a-separate-blink-window-or-elsewhere-than-stout/37014 "2020-04-04T12:07:45Z")

</div>

I am writing UI using blink and Interact. I am fairly new to the use of tasks and CSS, so maybe my problem is actually fairly easy. During different operations, I use print to write messages such as “wait for…”, “all go…

---

## [Timedwait() doesn't time out](https://discourse.julialang.org/t/timedwait-doesnt-time-out/71182)

<div class="topic-metadata">

**Author:** [@kykim0](https://discourse.julialang.org/u/kykim0)\
**Replies:** 4\
**Last updated:** [November 10, 2021, 4:17pm UTC](https://discourse.julialang.org/t/timedwait-doesnt-time-out/71182 "2021-11-10T16:17:14Z")

</div>

I’m new to Julia’s multi-threading and frankly Julia itself. I’ve been reading up on the API docs and trying various things on REPL. In particular, I was playing with the timedwait() method which IIUC runs a given functi…

---

## [Unlock from wrong thread](https://discourse.julialang.org/t/unlock-from-wrong-thread/70604)

<div class="topic-metadata">

**Author:** [@whatsthecraic](https://discourse.julialang.org/u/whatsthecraic)\
**Replies:** 1\
**Last updated:** [October 29, 2021, 11:58am UTC](https://discourse.julialang.org/t/unlock-from-wrong-thread/70604 "2021-10-29T11:58:20Z")

</div>

Hi there, when unlocking a ReentrantLock from a different thread than the one that acquired the latch in the first place, julia raises the exception “unlock from wrong thread”. As the latch is associated to a resource,…

---

## [See usage of Channel (i.e. how many items are enqueued)](https://discourse.julialang.org/t/see-usage-of-channel-i-e-how-many-items-are-enqueued/69284)

<div class="topic-metadata">

**Author:** [@torrance](https://discourse.julialang.org/u/torrance)\
**Replies:** 2\
**Last updated:** [October 6, 2021, 11:09am UTC](https://discourse.julialang.org/t/see-usage-of-channel-i-e-how-many-items-are-enqueued/69284 "2021-10-06T11:09:37Z")

</div>

I am using buffered Channels as a stream between different parts of my program, and I’d like to regularly find out how much of a buffered channel is actually used. For example, if the channel is regularly empty, I know …

---

## [Best way for a task to read from two channels](https://discourse.julialang.org/t/best-way-for-a-task-to-read-from-two-channels/68704)

<div class="topic-metadata">

**Author:** [@adriano.vilela](https://discourse.julialang.org/u/adriano.vilela)\
**Replies:** 25\
**Last updated:** [September 27, 2021, 12:48am UTC](https://discourse.julialang.org/t/best-way-for-a-task-to-read-from-two-channels/68704 "2021-09-27T00:48:30Z")

</div>

Hi, I’m working on a problem that involves tasks communicating through channels. I have a task that needs to read from two channels and I’m trying to figure out the best way of doing that. The task needs to read an in…

---

## [Help implementing task parallelism in Julia](https://discourse.julialang.org/t/help-implementing-task-parallelism-in-julia/68545)

<div class="topic-metadata">

**Author:** [@adriano.vilela](https://discourse.julialang.org/u/adriano.vilela)\
**Replies:** 11\
**Last updated:** [September 23, 2021, 11:31pm UTC](https://discourse.julialang.org/t/help-implementing-task-parallelism-in-julia/68545 "2021-09-23T23:31:58Z")

</div>

Dear fellow Julians, I’m currently working on a project about using computer vision to monitor vast areas for wild fires. We currently have a working version of the software implemented in Python. The code is running on…

---

## [Passing \`val\` to notify on Condition](https://discourse.julialang.org/t/passing-val-to-notify-on-condition/67643)

<div class="topic-metadata">

**Author:** [@mzaffalon](https://discourse.julialang.org/u/mzaffalon)\
**Replies:** 2\
**Last updated:** [September 6, 2021, 9:09am UTC](https://discourse.julialang.org/t/passing-val-to-notify-on-condition/67643 "2021-09-06T09:09:54Z")

</div>

The manual (Tasks · The Julia Language) says that notify can pass val to its waiting conditions. How can I obtain val from the woken up conditions?

---

## [How to know when a task is done?](https://discourse.julialang.org/t/how-to-know-when-a-task-is-done/63978)

<div class="topic-metadata">

**Author:** [@singularitti](https://discourse.julialang.org/u/singularitti)\
**Replies:** 10\
**Last updated:** [July 5, 2021, 11:23am UTC](https://discourse.julialang.org/t/how-to-know-when-a-task-is-done/63978 "2021-07-05T11:23:16Z")

</div>

If I create a Task using @async, and want to do something (like changing some status) immediately after that task is done, how do I do that? I guess istaskdone can only let me check everytime manually. I don’t quite unde…

---

## [Error propagation with remote asynchronous tasks seems broken](https://discourse.julialang.org/t/error-propagation-with-remote-asynchronous-tasks-seems-broken/58489)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 0\
**Last updated:** [April 3, 2021, 10:40am UTC](https://discourse.julialang.org/t/error-propagation-with-remote-asynchronous-tasks-seems-broken/58489 "2021-04-03T10:40:19Z")

</div>

This works: julia\> @sync @spawnat 2 error("hi") ERROR: On worker 2: hi Stacktrace: \[1\] error @ ./error.jl:33 \[2\] #51 @ /buildworker/worker/package\_linux64/build/usr/share/julia/stdlib/v1.6/Distributed/src/macros…

---

## [@sync usage and better documentation for Asynchronous Programming](https://discourse.julialang.org/t/sync-usage-and-better-documentation-for-asynchronous-programming/51410)

<div class="topic-metadata">

**Author:** [@KaarthikSundar](https://discourse.julialang.org/u/KaarthikSundar)\
**Replies:** 1\
**Last updated:** [December 7, 2020, 7:50pm UTC](https://discourse.julialang.org/t/sync-usage-and-better-documentation-for-asynchronous-programming/51410 "2020-12-07T19:50:50Z")

</div>

I am trying to understand the usage of @sync and @async macros in Julia. I am trying to get this MWE to work and the program does not terminate. Any help is appreciated. function process\_node(nodes, id) @show id …

---

## [How to wait on a condition for tasks](https://discourse.julialang.org/t/how-to-wait-on-a-condition-for-tasks/48023)

<div class="topic-metadata">

**Author:** [@prototact](https://discourse.julialang.org/u/prototact)\
**Replies:** 10\
**Last updated:** [October 9, 2020, 12:33pm UTC](https://discourse.julialang.org/t/how-to-wait-on-a-condition-for-tasks/48023 "2020-10-09T12:33:02Z")

</div>

I am having some practice with tasks, channels and conditions. I would like to wait on a specific condition with a timeout. If the timeout ends, just put! a default value and continue, otherwise put! a specific value in…

---

## [Why don't we have: Base.broadcastable(task::Task) = Ref(task)?](https://discourse.julialang.org/t/why-dont-we-have-base-broadcastable-task-task-ref-task/47889)

<div class="topic-metadata">

**Author:** [@nielsls](https://discourse.julialang.org/u/nielsls)\
**Replies:** 2\
**Last updated:** [October 7, 2020, 6:47am UTC](https://discourse.julialang.org/t/why-dont-we-have-base-broadcastable-task-task-ref-task/47889 "2020-10-07T06:47:17Z")

</div>

Is there any reason why Task is not made broadcastable using: Base.broadcastable(task::Task) = Ref(task) Currently, the below line fails if task\_collection is a single Task (scalar): x = fetch.(task\_collection)

---

## [Channels and Conditions: How to do notify channel is ready](https://discourse.julialang.org/t/channels-and-conditions-how-to-do-notify-channel-is-ready/36904)

<div class="topic-metadata">

**Author:** [@prototact](https://discourse.julialang.org/u/prototact)\
**Replies:** 1\
**Last updated:** [April 2, 2020, 4:14pm UTC](https://discourse.julialang.org/t/channels-and-conditions-how-to-do-notify-channel-is-ready/36904 "2020-04-02T16:14:44Z")

</div>

Hi all, I am doing an exercise with Julia and the Task related primitives. It is a function that adds an array of integers from the left. There is also one symmetrical adding from the right. In the main function i sch…

---

## [Executing on the root Task from the REPL](https://discourse.julialang.org/t/executing-on-the-root-task-from-the-repl/34801)

<div class="topic-metadata">

**Author:** [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Replies:** 0\
**Last updated:** [February 18, 2020, 10:39am UTC](https://discourse.julialang.org/t/executing-on-the-root-task-from-the-repl/34801 "2020-02-18T10:39:11Z")

</div>

I would like to a explore a mechanism by which a user could execute a command from the REPL on the root task rather than the backend. Motivation: JavaCall Without JULIA\_COPY\_STACKS=yes it appears JavaCall will only fun…

[Previous page](https://discourse.julialang.org/tag/task/349.md?match_all_tags=true&tags%5B%5D=task)
