I wrote some code using Win32::GUI and ran into a similar puzzle, not quite threads but the same idea. I handled it by scheduling an event to fire after x seconds. When that event fires it will schedule another event to fire at x seconds, then goes about doing what it woke up to do. This allowed me to avoid sleeping as well as having a way to kill my scheduled events other than breaking the sleep. I use the same concept in some POE code I run. It helps keep a previous thread from running long and potentially overlapping with a new thread.
and now for something completely different... If you're really concerned about eating too many resources, maybe you could use Win32::Sleep() to give more resources back. I have no idea how/if it works with threads, I still haven't had a need to thread my own code.
Thanks. My concern about using resources is all about gathering the data to render, and not the sleep itself. The sleep is what I am implementing to reduce the load on the systems that this program creates.
This is a Solaris and Linux application, so Win32::Sleep is not going to help me.