Tagged articles
15 articles
Page 1 of 1
Liangxu Linux
Liangxu Linux
Dec 11, 2024 · Fundamentals

Why Do Processes Need Sleep? Inside Linux’s Sleep and Wake Mechanism

Processes must pause execution to wait for resources, and the Linux kernel provides sleep and wake mechanisms—implemented via functions like schedule_timeout_interruptible and try_to_wake_up—to efficiently relinquish CPU time, avoid busy‑waiting, and resume when resources become ready.

Linux kernelprocess schedulingsleep
0 likes · 10 min read
Why Do Processes Need Sleep? Inside Linux’s Sleep and Wake Mechanism
Liangxu Linux
Liangxu Linux
Nov 17, 2024 · Operations

Why Processes Need Sleep and Wakeup: Linux Kernel Mechanisms Explained

Processes represent execution contexts that include code and resources; to avoid wasteful busy‑waiting, operating systems let them sleep and later wake them, using mechanisms like schedule_timeout_interruptible, timers, and try_to_wake_up, which the Linux kernel implements through specific state changes and scheduling logic.

Linux kernelSystem Programmingprocess scheduling
0 likes · 10 min read
Why Processes Need Sleep and Wakeup: Linux Kernel Mechanisms Explained
Liangxu Linux
Liangxu Linux
Dec 18, 2023 · Operations

How to Stop Ubuntu from Auto‑Locking and Sleeping After Inactivity

This guide explains why Ubuntu locks the screen after a few minutes of idle and provides three practical methods—adjusting power settings, using the Caffeine app, and editing UPower configuration—to prevent automatic sleep, along with step‑by‑step commands and warnings about energy efficiency.

CaffeineUPowerUbuntu
0 likes · 4 min read
How to Stop Ubuntu from Auto‑Locking and Sleeping After Inactivity
Cognitive Technology Team
Cognitive Technology Team
Nov 1, 2023 · Fundamentals

Differences and Similarities between wait() and sleep() in Java

Both wait() and sleep() can pause a thread and enter waiting states, but wait() belongs to Object and requires synchronized blocks, releases the monitor lock, and must handle spurious wakeups, whereas sleep() is a Thread method that does not release locks and has simpler usage.

SynchronizationThreadconcurrency
0 likes · 4 min read
Differences and Similarities between wait() and sleep() in Java
Liangxu Linux
Liangxu Linux
Jun 5, 2023 · Fundamentals

How Linux Schedules Processes: Sleep, Wakeup, and Avoiding Invalid Wakeups

This article explains Linux process states, how the scheduler puts a running task to sleep with TASK_INTERRUPTIBLE or TASK_UNINTERRUPTIBLE, how wake_up_process() restores TASK_RUNNING, why invalid wakeups occur due to race conditions, and the kernel techniques used to prevent them.

Linuxkernelprocess-scheduling
0 likes · 11 min read
How Linux Schedules Processes: Sleep, Wakeup, and Avoiding Invalid Wakeups
Liangxu Linux
Liangxu Linux
Apr 26, 2022 · Operations

Master Linux sleep and wait: Precise Timing and Process Synchronization

This guide explains how to use the Linux sleep and wait commands for pausing execution, specifying time units, handling sub‑second intervals, running periodic tasks, and synchronizing background processes, complete with practical Bash examples and detailed explanations.

BashLinuxScripting
0 likes · 5 min read
Master Linux sleep and wait: Precise Timing and Process Synchronization
Byte Quality Assurance Team
Byte Quality Assurance Team
Sep 1, 2021 · Backend Development

Using Polling Instead of Sleep in Python for Asynchronous Tasks

The article explains why fixed sleep calls are inefficient for asynchronous operations, introduces polling as a flexible alternative, provides Python code examples with the polling library, discusses advantages and disadvantages, and presents decorator and generic‑function abstractions for reusable polling logic.

AsynchronousDecoratorPolling
0 likes · 7 min read
Using Polling Instead of Sleep in Python for Asynchronous Tasks
Selected Java Interview Questions
Selected Java Interview Questions
Mar 30, 2020 · Backend Development

Understanding Java Thread States and Synchronization Methods: wait/notify, sleep/yield, and join

This article explains Java thread lifecycle states, demonstrates how to use wait, notify, and notifyAll for inter‑thread coordination, compares sleep, yield, and join methods with practical code examples, and highlights important considerations such as monitor ownership and thread scheduling.

Synchronizationsleepwait/notify
0 likes · 15 min read
Understanding Java Thread States and Synchronization Methods: wait/notify, sleep/yield, and join
ITPUB
ITPUB
Oct 22, 2017 · Fundamentals

Why Can't Interrupt Handlers Sleep? Understanding Linux Kernel Sleep and Wakeup Mechanisms

This article explains the purpose and mechanics of process sleep in the Linux kernel, detailing how wait queues and wake‑up functions operate, why sleeping in atomic contexts such as interrupt handlers or while holding spinlocks is unsafe, and demonstrates the resulting deadlock with a sample driver.

Linux kernelSpinlockinterrupt context
0 likes · 16 min read
Why Can't Interrupt Handlers Sleep? Understanding Linux Kernel Sleep and Wakeup Mechanisms
ITPUB
ITPUB
Jul 14, 2017 · Operations

Why Linux Processes Sleep Wrongly and How to Prevent Invalid Wakeups

This article explains the Linux kernel's process sleep and wake‑up mechanisms, distinguishes interruptible and uninterruptible states, demonstrates how race conditions cause invalid wakeups, and provides concrete code patterns and kernel examples to avoid such bugs.

Operating Systemsinvalid wakeupprocess scheduling
0 likes · 11 min read
Why Linux Processes Sleep Wrongly and How to Prevent Invalid Wakeups
ITPUB
ITPUB
Sep 16, 2016 · Fundamentals

Why Interrupt Handlers Can't Sleep: Deep Dive into Linux Kernel Sleep and Wakeup

This article explains the purpose and mechanics of process sleep in the Linux kernel, describes how wait queues and wake‑up functions operate, and details why sleeping in interrupt context or while holding spinlocks, seqlocks, or RCU locks leads to deadlocks and system crashes.

LinuxSynchronizationinterrupt()
0 likes · 16 min read
Why Interrupt Handlers Can't Sleep: Deep Dive into Linux Kernel Sleep and Wakeup