|
|
|
|||||
|
Ice and single threaded libraries
Now I have another somewhat quirky question, where you'll likely be polite and ask me if I have a commercial need
![]() Anyway Ice is completely multithreaded, which is nice and fine for most things. However other third party libraries are sometimes not thread safe, and sometimes even require that only a certian thread works on their datastructures. An example (totally random naturally) would be a 3D engine where only the engines own thread is allowed to modify the scene graph. To a certain extent these things can be handled by using mutexes etc. to synchronise the various threads. However for remote calls that want to modify the scenegraph, it seems necessary to buffer the incomming call, and the have the main thread resolve it in some ticked loop. This buffering will likely require the call-data to be serialised in some fashion. And since the call was already serialised when is was sent as a remote call, I was wondering if it was somehow possible to 'intercept' the Ice unmarshalling process, and buffer the call at that point, instead of having to go through a lot of unmarshaling just to serielise all the data again. I hope I've explained the problem clearly enough. mvh Nis |
|
|||||
|
Thanks - That was very helpful.
It is still unclear if we really need to take this step, but if we do Dynamic Ice sounds like the most elegant solution in our perticular case (There are several different calls that it would be nice to be able to handle the same way, and on the positive side most of them don't send back any results). I'll definately have to look more at that. For instance it is a bit unclear to me if it is possible receive a request as a blob of bytes, even if the client called a specific function. Ie. the client knows a specific interface interface foo { void bar(int x); }; It somehow gets a proxy of type FooPrx and invokes bar on this. Is it then possible to use Dynamic Ice, to receive this call as a simple blob of bytes server side. You seem to be doing something like this in IceStorm, where I can take a generic publisher proxy, cast it to an interface I've designed, and invoke the operations on that interface. Should I simply look at the IceStorm code to get inspiration for how this is done ? Also the ice_invoke operation returns a boolean, suggesting that it can't be called over one-way proxies? Or am I missing something here? Finally I was wondering how Dynamic Ice performs compared to regular Ice. If I use this solution of receiving requests as byteblobs, store them and handle them later, I will have to spend some time unmarshaling later. But I assume I'll that approximately the same time by not unmarshalling data when I receive it? Or ? Quote:
In any case, thanks for the clear reply. It seems we definately have another option if our current solution doesn't work out. |
|
||||||
|
Manually marshaling and unmarshaling using blobs is error-prone, since there is no indication given at compile-time if your code no longer matches the Slice definitions of the operations. For this reason, I recommend doing this only as a last resort. The "blobject" support in Ice is really provided to efficiently support services such as the Glacier2 router and IceStorm that forward requests without unmarshaling them.
As a first step, I recommend using AMD and queuing the callback objects and input parameters, which avoids the need for any manual unmarshaling. Quote:
Quote:
Quote:
- Mark |
|
|||||
|
Quote:
By the rest of your comments it sound like Dynamic Ice could do what we want if it turns out we really need it, and reasonably efficiently at that. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Is the IceGrid registry a single point of failure? | timp | Help Center | 1 | 01-16-2006 07:05 AM |
| Only multi-threaded DLL libraries can be used with Ice! | chenhong_sz | Bug Reports | 4 | 04-20-2005 05:23 AM |
| How can I run my ice server program in multi-threaded mode | level | Bug Reports | 4 | 03-31-2004 09:45 PM |
| ICE calling a Single Threaded DLL | amrufon | Help Center | 7 | 08-04-2003 10:49 PM |
| single stream for two-way communication? | vukicevic | Help Center | 2 | 05-19-2003 04:17 PM |