question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

System Usage Task: Use Thread.Sleep Conditionally for netstandard 2.0 onwards

See original GitHub issue

We are continuously addressing and improving the SDK, if possible, make sure the problem persist in the latest SDK version.

Describe the bug In SDK, we have a background job which collects system usage information. Its blocking in nature. We need to optimize it for netstandard2.0 version and above code.

Fix Instead of Task.Delay().Wait() we can use Thread.Sleep for netstandard2.0 version onwards.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
aavasthycommented, Nov 2, 2022

Hi @aavasthy just checking on the release of this, is it included in the latest release of the cosmos nuget (3.31.1 - https://github.com/Azure/azure-cosmos-dotnet-v3/blob/master/changelog.md#-3311---2022-10-29)?

Yes @laithhisham it went live with this release.

0reactions
laithhishamcommented, Nov 2, 2022

Hi @aavasthy just checking on the release of this, is it included in the latest release of the cosmos nuget (3.31.1 - https://github.com/Azure/azure-cosmos-dotnet-v3/blob/master/changelog.md#-3311---2022-10-29)?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use Thread.Sleep with Task.Run without blocking ...
The method runs on the current synchronization context and uses time on the thread only when the method is active. You can use...
Read more >
Thread.Sleep Method (System.Threading)
Suspends the current thread for the specified amount of time. ... The following example uses the Sleep method to block the application's main...
Read more >
Task.Delay consumes lot of CPU · Issue #85762
The thing is if the thread/process is waiting for work it should not consume that much CPU. In our case the CPU utilization...
Read more >
How to Use Thread.sleep Without Blocking on the JVM
2 tasks -> 1 thread​​ The tasks have no choice but to run one after the other because the thread is taken out...
Read more >
Pausing Execution with Sleep (The Java™ Tutorials ...
sleep causes the current thread to suspend execution for a specified period. This is an efficient means of making processor time available to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found