Under nix, I believe that running like this will result in the kernel penalising the process by dropping it's priority as it is showing up as a process hog. This isn't good for LH as it may not get the CPU cycles when it actually needs them.
2010/1/4 Christopher Hoover <[email protected]>: > On 1/3/2010 5:53 PM, [email protected] wrote: >> >> It's not an issue, except possibly vis-a-vis battery life in a laptop. >> > > I haven't looked at the source code, but there are other concerns with the > "while (true) { checkStuff(); Sleep(0); }" approach. > > According to the TFM, Sleep(0) is effectively a NOP when there are no other > processes at that priorty ("If there are no other threads of equal priority > ready to run, the function returns immediately, and the thread continues > execution."). > > It also follow from the TFM that it will keep lower priority processes from > running at all. > > For me, I'm most worried about behavior under virtualization -- this is > unlikely to play nice under a VM unless you choose a non-work conserving > scheduler (which most people don't choose). Are you thinking about running it inside a Windows VM on top of another OS? > I would add that laptops are not the only machines these day that do > effective power management. This will likely keep your cores out of any > P-states, and the higher power dissipation will keep fans running (higher). > > As I mentioned off list, a better approach, if it can be made to work with > the current code structure, is select(2) or poll(2) (or one of the newer > variants) on UN*X.. The equivalent, TTBOMK, for Win32 is > WaitForMultipleObjects. All of these leave the process unscheduled until > there I/O is available or a timeout occurs. Like what he said! Steve Rooke > -ch > > > > > > > > _______________________________________________ > time-nuts mailing list -- [email protected] > To unsubscribe, go to > https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts > and follow the instructions there. > -- Steve Rooke - ZL3TUV & G8KVD A man with one clock knows what time it is; A man with two clocks is never quite sure. _______________________________________________ time-nuts mailing list -- [email protected] To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts and follow the instructions there.
