-
Notifications
You must be signed in to change notification settings - Fork 42
Closed
Description
Summary
When detaching from a shpool session, users experience noticeable latency (100 to 300ms delay) and slow responsiveness. The detach operation uses conservative polling intervals that cause threads to stay blocked waiting for poll cycles, making the detach feel sluggish.
The polling intervals (100ms for thread joins and shell->client communication) are too conservative, causing noticeable delay between issuing detach and the operation completing.
Current limitation
# Detach is noticeably slow
$ shpool attach mysession
# ... work ...
# Ctrl+D to detach
# (noticeable 100-300ms delay before detach completes)Impact
- Users experience sluggish detach behavior
- Threads stay blocked waiting for poll cycles after detach
- Degraded user experience when switching between sessions
- Makes shpool feel less responsive compared to native terminal detach
Changes
- Reduce polling intervals from 100ms to 10ms for faster thread joins
- Reduce shell->client polling from 100ms to 10ms for faster detach detection
- Implement adaptive backoff (1ms initial, exponential to 25ms max) to avoid busy waits
- Add fast path for TTY detach (10ms) vs slow path fallback (300ms max)
- Exit client->shell thread immediately after detach action
- Check stop flag during polling intervals for faster responsiveness
PR
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels