Archived
This forum has been archived. Please start a new discussion on GitHub.
What is the default priority of the Ice thread ?
russule
in Help Center
Hi,
What is the default priority of the Ice thread ?Can I set the priority of the Ice thread?
Thanks,
What is the default priority of the Ice thread ?Can I set the priority of the Ice thread?
Thanks,
0
Comments
-
While Ice does not provide some special thread-priority setting, it gives you the ability to register a callback that runs in any thread created by an Ice communicator:
class ThreadNotification : public IceUtil::Shared { public: virtual void start() = 0; virtual void stop() = 0; }; typedef IceUtil::Handle<ThreadNotification> ThreadNotificationPtr; // // Communicator initialization info // struct InitializationData { PropertiesPtr properties; LoggerPtr logger; StatsPtr stats; StringConverterPtr stringConverter; WstringConverterPtr wstringConverter; ThreadNotificationPtr threadHook; };
In start() you could change the priority of the current thread, e.g. implement start as:SetThreadPriority(GetCurrentThread(), THREAD_MODE_BACKGROUND_BEGIN);
Please note:
- we did not test such thread-priority modification
- this thread-notification callback applies to all threads created by a communicator, not just the threads in a specific thread pool
Best regards,
Bernard0
