# TIMED\_WAITING - Threads Interpretation

**URL:** <https://forum.inductiveautomation.com/t/timed-waiting-threads-interpretation/54828>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [January 10, 2022, 12:38pm UTC](https://forum.inductiveautomation.com/t/timed-waiting-threads-interpretation/54828 "2022-01-10T12:38:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Italo\_Araujo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/italo_araujo/32/42108_2.png) [@Italo\_Araujo](https://forum.inductiveautomation.com/u/Italo_Araujo)\
**Post date:** [January 10, 2022, 12:38pm UTC](https://forum.inductiveautomation.com/t/timed-waiting-threads-interpretation/54828/1 "2022-01-10T12:38:02Z")

</div>

Hi,  
What does the following Threads mean, are there any bugs that can be fixed?

Thread [drivers-controllogixdriver-PROCESSO 2-2] id=1408070, (TIMED\_WAITING for java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@2d324ae0)  
sun.misc.Unsafe.park(Native Method)  
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)  
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)  
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)  
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)  
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)  
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)  
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)  
java.lang.Thread.run(Thread.java:745)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/e/be43d4e9b72d96cbcf8f626f74855458e0b9a08e.png)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 10, 2022, 2:13pm UTC](https://forum.inductiveautomation.com/t/timed-waiting-threads-interpretation/54828/2 "2022-01-10T14:13:24Z")

</div>

Looks normal to me. WAITING and TIMED\_WAITING are fine. When they show RUNNABLE very much, you might be in trouble.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [January 10, 2022, 3:27pm UTC](https://forum.inductiveautomation.com/t/timed-waiting-threads-interpretation/54828/3 "2022-01-10T15:27:33Z")

</div>

Yeah, that’s a perfectly normal thread status that just means ‘waiting in a queue for work’.

---

<div class="post-metadata">

**Author:** ![michal.koblasa](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@michal.koblasa](https://forum.inductiveautomation.com/u/michal.koblasa)\
**Post date:** [August 31, 2022, 5:54am UTC](https://forum.inductiveautomation.com/t/timed-waiting-threads-interpretation/54828/4 "2022-08-31T05:54:39Z")

</div>

And when it is TIMED\_WAITING and consumes 5-7% of CPU per thread?  
I do not think, that waiting should consume so much CPUs.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/f/9f16aab445f8165a4a7acca69b069dce1bf761ef.png)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 31, 2022, 12:14pm UTC](https://forum.inductiveautomation.com/t/timed-waiting-threads-interpretation/54828/5 "2022-08-31T12:14:03Z")

</div>

Timed waiting often means `sleep()`. Do you have scripts that spin in a loop checking a condition with a short sleep in each iteration? If so, don’t do that.

---

<div class="post-metadata">

**Author:** ![michal.koblasa](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@michal.koblasa](https://forum.inductiveautomation.com/u/michal.koblasa)\
**Post date:** [August 31, 2022, 12:44pm UTC](https://forum.inductiveautomation.com/t/timed-waiting-threads-interpretation/54828/6 "2022-08-31T12:44:45Z")

</div>

Thank you, I will review the code. I know about some sleep after startup of the component:  
But this should not be the issue, it should be called just once after page is loaded.

```auto
OnStartup:
sleep(0.5)
component.focus()

```

Maybe i have other nasty waiting, i will go through code.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [August 31, 2022, 2:00pm UTC](https://forum.inductiveautomation.com/t/timed-waiting-threads-interpretation/54828/7 "2022-08-31T14:00:51Z")

</div>

The CPU% column needs to be taken with a grain of salt as well. It is a calculated value that represents the CPU usage over some recent elapsed time, it’s not atomic and correlated with the current stack trace you may see for that thread.

It is common to see a now-idle thread that _was_ doing work, but now isn’t, have a non-zero CPU % number.
