Archived
This forum has been archived. Please start a new discussion on GitHub.
Thread and Timer Questions (Windows 7, 64 bit)
in Help Center
These questions are with respect to running in a real-time environment (under Windows 7, 64-bit Embedded).
* What are the "int priority" value parameters for both the Timer and Thread classes (do these equate to Windows thread priority values?, an ICE defined enumeration?, is 1 low or high?, what is the range?, etc.) - I can't seem to find any documentation.
* It seems that the priority functions can only be used when running as an Administrator - is that true? (Otherwise trying to set the priority generates exceptions for both threads and timers.)
* However, running as an administrator, it seems like I can still generate exceptions when creating a timer (a priority of '5' worked, but '18' generated exception - but not always repeatable).
* What exactly is happening when the ICE priority is raised \ lowered? (Same as setting the thread priority in Windows via SetThreadPriorityAPI()?)
* Is it possible to raise \ lower the priority during thread execution?
* To run a periodic code function, which is more efficient (scheduler, overhead of system, etc.) \ would you recommend running an Ice thread and sleep() or a timer and scheduleRepeated()?
Thanks for the help.
* What are the "int priority" value parameters for both the Timer and Thread classes (do these equate to Windows thread priority values?, an ICE defined enumeration?, is 1 low or high?, what is the range?, etc.) - I can't seem to find any documentation.
* It seems that the priority functions can only be used when running as an Administrator - is that true? (Otherwise trying to set the priority generates exceptions for both threads and timers.)
* However, running as an administrator, it seems like I can still generate exceptions when creating a timer (a priority of '5' worked, but '18' generated exception - but not always repeatable).
* What exactly is happening when the ICE priority is raised \ lowered? (Same as setting the thread priority in Windows via SetThreadPriorityAPI()?)
* Is it possible to raise \ lower the priority during thread execution?
* To run a periodic code function, which is more efficient (scheduler, overhead of system, etc.) \ would you recommend running an Ice thread and sleep() or a timer and scheduleRepeated()?
Thanks for the help.
0
Comments
-
What are the "int priority" value parameters for both the Timer and Thread classes (do these equate to Windows thread priority values?, an ICE defined enumeration?, is 1 low or high?, what is the range?, etc.) - I can't seem to find any documentation.
see: ThreadsIt seems that the priority functions can only be used when running as an Administrator - is that true? (Otherwise trying to set the priority generates exceptions for both threads and timers.)* However, running as an administrator, it seems like I can still generate exceptions when creating a timer (a priority of '5' worked, but '18' generated exception - but not always repeatable).
18 isn't a valid priority in windows, see here Scheduling Priorities (Windows)What exactly is happening when the ICE priority is raised \ lowered? (Same as setting the thread priority in Windows via SetThreadPriorityAPI()?)Is it possible to raise \ lower the priority during thread execution?To run a periodic code function, which is more efficient (scheduler, overhead of system, etc.) \ would you recommend running an Ice thread and sleep() or a timer and scheduleRepeated()?0 -
Thanks (and apologies ... I missed the part in the documentation where it said the priority is passed through to SetThreadPriority in Windows).
I don't see any /cpp/test/IceUtil/ directory (or anything close to that) in my ICE install directory (3.4.1) and searched my hard drive and can't find the dir or executable. Do I need to install something else to get this utility?
As for Administrator \ non-Administrator exceptions, the exception generated is "IceUtil::ThreadSyscallException" if that helps.0 -
FYI ... It looks like if I change the priority values to those defined in Windows documentation (THREAD_PRIORITY_TIME_CRITICAL, THREAD_PRIORITY_NORMAL, etc.) all seems fine in non-Admin. mode. Many apologies, if I had seen the Windows reference in the documentation the first time, I would have saved you the time on this one.
All is fine - thanks again for the help.0 -
The test suite is part of our source distributions, ZeroC - Download
It Windows is better to use the constants THREAD_PRIORITY_TIME_CRITICAL, ...., when using numbers they depend on the "Process priority class" Ice doesn't change the priority class at all, so a priority number can be valid with a priority class but not with others.
Glad things are working for you.0