|
Ice does not have a main loop -- it's not a wrapper on top of a single-threaded library.
Assuming you use Ice and OpenSceneGraph in a server, each Ice request will be dispatched using a thread from the Ice server thread pool; if the request needs to interact with OpenSceneGraph, it will most likely need to enqueue a work-item and wait for OSG's thread to pick up this work-item.
In an Ice client, sending Ice requests from the OSG thread is possible, but can block for various reasons:
- the server is slow to respond (solution: use AMI)
- establishing the connection to the server takes a long time (e.g. because the server is out of thread)
- the client TCP buffer is full (typically because the server is overloaded or deadlocked)
It would be safer, although more complicated, to use a separate thread to send these requests.
Cheers,
Bernard
|