# Inconsistent CPU utilisation in @threads loops

**URL:** <https://discourse.julialang.org/t/inconsistent-cpu-utilisation-in-threads-loops/110512>\
**Category:** Performance\
**Tags:** parallel, multithreading, threads, threading\
**Created:** [February 21, 2024, 12:49pm UTC](https://discourse.julialang.org/t/inconsistent-cpu-utilisation-in-threads-loops/110512 "2024-02-21T12:49:19Z")\
**Posts on this page:** 1\
**Showing post:** 21

<div class="post-metadata">

**Author:** ![ysh](https://avatars.discourse-cdn.com/v4/letter/y/df788c/32.png) [@ysh](https://discourse.julialang.org/u/ysh)\
**Post date:** [February 23, 2024, 8:55pm UTC](https://discourse.julialang.org/t/inconsistent-cpu-utilisation-in-threads-loops/110512/21 "2024-02-23T20:55:43Z")

</div>

So I was trying to do exactly what was asked in [Question on TaskLocalValue](https://discourse.julialang.org/t/question-on-tasklocalvalue/110658).  
Say I have a matrix `M` and I need to calculate eigenvectors of matrices `M .+ i` for `i in 1:100` with 8 cores. But matrices `M .+ i` are large and I cannot preallocate a hundred of those; I create task-local buffers `m` instead (and on each iteration I would then do `m .= M .+ i`). This does the job, but I observe the same core-stopping behaviour as in the original MWE. Anyway, I am not too concerned now that I know that the correct way to do this is to use Channels 😄

---

_[View the full topic](https://discourse.julialang.org/t/inconsistent-cpu-utilisation-in-threads-loops/110512)._
