Tiny thread issues 🧵

To make sounds on the Thumby while something else is happening you need threads. In a sane world, spawn all the threads you want, and the machine does its best to allocate processing time to them using whatever cores it has and/or time sharing. Not on Thumby. There are two cores, and that means two threads max. I've been playing tunes by starting a new thread every time, and it's worked. Each thread ends before it's time for another tune to play. Except when it doesn't. Sometimes a tune thread hangs around. Then when it's time for another tune, that's a third thread and "OSError: core1 in use" and it crashes.

The upshot of all this is I need one music thread that's always running, and I need to grok some Python stuff about sharing and/or passing data between threads. I'm not happy because it was all working fine. Or so I thought.

Grumble, grumble...

=> #programming | #Thumby

=> gemlog

Proxy Information
Original URL
gemini://freeshell.de/gemlog/2023-12-27_Tiny_thread_issues.gmi
Status Code
Success (20)
Meta
text/gemini;lang=en-GB
Capsule Response Time
103.846102 milliseconds
Gemini-to-HTML Time
0.307023 milliseconds

This content has been proxied by September (ba2dc).