Back to Prompts
Coding Assistant

Move a Task to Background Thread

Start here. The most common threading fix From the Multi-Threading AI Coding Building Block.

Prompt
My [desktop app / Electron app / mobile app] freezes when I click the button that [downloads a file / processes images / queries a database / loads data].

Move this task to a background thread so the UI stays responsive. While the task runs:
- Show a loading spinner or progress bar
- Keep all buttons and UI elements clickable
- When the task finishes, update the UI with the results
- If the task fails, show an error message without crashing

My stack: [your language and framework here, e.g. Python + Tkinter, C# + WinForms, Java + Swing, Electron]

I'm learning, so explain each part simply.
0 views 0 copies