Re: [boost] Re: RPC library

On Thu, 2005-03-03 at 22:28 +0000, Jarl Lindrud wrote:
Iain Hanson <Iain.Hanson <at> videonetworks.com> writes:
[snip]
I hardly find 5 lines of code onerous. And it is easy to wrap up part of it in a template. Quick and dirty may be something you do to learn how to do something. But AFAIK, not something we create boost libraries for. IDL is what gives you type safety, something we usually appreciate in C++.
And whoever will be looking at my code needs to learn these things as well.
This is something that never fails to amaze me. Building distributed systems is hard to do correctly. It is very similar to the difficulty with threaded systems but the issues are subtly different and I think harder in distributed systems. If you can't learn a few conventions in half a day, then you probably have no business trying to build such systems. I probably spend half of my working life fixing systems that have been quickly hacked and then put into production. CORBA /EJB both have marketed themselves as the easy and safe way to write distributed systems and they are not. They are easy to write bad systems in. What you are proposing is an easier way to write even worse systems.
You already have to link to the serialization library that you have had to build. I don't understand the difference. And your user needs to understand the trade-offs with each archive format.
Your client has 4 lines of code to my 5 and you have macros in your interface. Not normally considered a good thing. And you have hard coded the server location. Always considered a bad thing in anything but toy code. [snip]
There are low level systems that need to work with sockets. The IETF has made a pretty good job of making the internet protocols scale. And there are hard and soft real time projects that need to use sockets. There are probably a lot of applications that have been built using sockets that should have used CORBA. Cost has historically been a big issue with CORBA because commercial implementations have typically ( in the U.K. ) cost of the order of £3,500 per developer a year and £2,500 per user a year run time.
If you are just playing around then I don't have a problem. But I don't think boost is in the habit of adopting toys. The problem with over simplified solutions is that a prototype is built, the boss asks for a few extra features, and before you know it, its rolled out to production and know one will pay for it to be re-written properly :-(.
Personally I tend to prefer not letting programmers shoot themselves in the foot, if I can avoid it. Unfortunately, they ( and I sometimes ) are incredibly inventive at finding new ways to do so ;-). /ikh

Iain Hanson <Iain.Hanson <at> videonetworks.com> writes:
Your position seems to be that programmers should not be afforded the option
of
To sum up then, your position is that: 1) CORBA is the be-all and end-all of distributed programming. 2) Anything not projected to need CORBA-style scaleability is just a "toy" and not worthy of library support. I guess you don't find much need for networking at all in Boost? At least not beyond lowlevel socket API wrappers and assorted utilites that might be useful for something like realtime socket apps. Anything beyond that can, and should, be done with CORBA, regardless of scale and scope. /Jarl.

Iain Hanson <Iain.Hanson <at> videonetworks.com> writes:
Your position seems to be that programmers should not be afforded the
On Sun, 6 Mar 2005 22:59:43 +0000 (UTC), Jarl Lindrud wrote option
Sorry I haven't had time to follow this whole thread, but I've written a few Corba and distributed programs over the years and I think there is a place for varying support levels. CORBA is way, way overkill for many simple applications (retrieve a web page, register a product on a remote site, snap some data from a server on startup, etc). There is hardly anyway to make a CORBA application light weight, it introduces the idl compiler, a whole set of new types, typically threading, etc. Also, the CORBA binding to C++ is a pain in my view -- someone could redo it with modern C++ and things would be much better, but I don't see anyone talking about that. But I digress. And Ian, you should be happy that people are messing up distributed apps -- means more employment for those that know how to fix things ;-) As for RPC, I can see Ian's point -- it's a slippery slope. You can quickly wind up reinventing the wheel yet again. That said, I think it's a line that can be walked, so I think you should keep going. But this will undoubtedly come up in the review, so you'll have to be really clear about the niche you are filling. Jeff ps: I haven't had a chance to look at your library yet...

"Jeff Garland" <jeff@crystalclearsoftware.com> writes:
Also, the CORBA binding to C++ is a pain in my view -- someone could redo it with modern C++ and things would be much better,
Have you looked at ZeroC's Ice?¹
but I don't see anyone talking about that.
Doug Schmidt and Steve Vinoski have written several articles about the difficulty involved in updating the OMG C++ mapping. As I recall, they argued that it's not that everyone doesn't there's plenty of room for improvement, but rather that the interested parties had trouble finding consensus as to how to update the mapping. Footnotes: ¹ http://www.zeroc.com/icecpp.html -- Steven E. Harris

On Sun, 06 Mar 2005 18:24:15 -0800, Steven E. Harris wrote
Yes, I read the docs a few months ago and it looks really good. These guys are incredibly smart about distributed computing and have been deeply involved in CORBA -- so they know the good, the bad, and the ugly of CORBA. Only thing is, they want to make money off their knowledge (see the license -- GPL for open source use, pay them for commercial) -- can't blame em. So this stuff won't be coming to the C++ standard or any other standard in the near future...
That's too bad because leaving it alone means lots of heartache when doing CORBA programming -- makes me avoid it when I can. If the C++ mapping were cleaner I might have a better attitude toward using CORBA because it has some really nice and essential features for distributed programming. Jeff

----- Original Message ----- From: "Jarl Lindrud" <jlindrud@hotmail.com> To: <boost@lists.boost.org> Sent: Monday, March 07, 2005 11:59 AM Subject: [boost] Re: RPC library
[snip]
I guess you don't find much need for networking at all in Boost? At least
not
Hi Jarl, I have browsed your CodeProject materials and followed this thread with interest. The project was familiar but with the pertinent magazine no longer in my possession, I cannot give you the proper acknowledgements. Was that your work in CUJ? The library looks good and it is underpinned by a well-known model, i.e. a procedure call. This is part of its basic strength and also IMO its failing. Before I attempt to back this up, I would first like to state that RPC-type mechanisms deliver a very useful facillity and your library is a clean example of such a facillity. In Boost-form it would be even more appealing. My difficulty with RPC is that its goal is to deliver the appearance of a callable local (i.e. in the same address space) object. In one sense this is desirable but in another sense I believe this to be "sub-optimal" thinking. Implementation of an RPC will involve multiple network "sends". At a minimum there will be a "request" (client to server) and a "response" (server to client). This can be represented as below; CLIENT -> [REQUEST] -> SERVER CLIENT <- [RESPONSE] <- SERVER An immediate difficulty for me is that the calling client is blocked for the period spanning the two transmissions. More importantly there may be interesting activity in the server during that period that the client would like to know about. The RPC model doesnt lend itself to this type of interaction; CLIENT -> [REQUEST] -> SERVER CLIENT <- [PROGRESS] <- SERVER CLIENT <- [PROGRESS] <- SERVER CLIENT <- [..] <- SERVER CLIENT <- [RESPONSE] <- SERVER To cut a long story short, I believe what is really needed is a "signaling" or "messaging" library. Construction of an RPC facillity over the top of such a library would be perfectly valid. The "sub-optimal" thinking I mentioned earlier is my term for a development environment where RPC is considered the basic building block for distributed computing. The long version of this story would cover things like sockets, marshalling, serialization, I/O multiplexing, threading, state machines and application protocols. Its interesting that several of these topics have their own concurrent threads. Somewhat sadly I think that the stiffest resistance to a messaging library is cultural; akin to the resistance to OO. Moving to a pure messaging world is non-trivial. Its almost a necessity to "go state-driven" at the same time. Its been sobering to observe the reception that Andreas' FSM library has received. If this message is useful to you maybe its to help decompose the design and implementation of RPC. If the internals of your RPC were totally message-based and state-driven then perhaps everyone would be happy. Well, I would be :-) Cheers, Scott

Scott Woods <scottw <at> qbik.com> writes:
No, but I think I remember the article you're referring to, in fact here it is: http://www.cuj.com/documents/s=8206/cujweb0304batov/ I haven't really looked at it, but in some ways it's quite similar.
<snip>
Thanks for the comments Scott, You have some good points. I agree with you that its poor style to have a client block while waiting for a reply. In fact, blocking functions are almost always poor style, whether you're dealing with network communications or anything else. Someone mentioned previously in this thread as well, that it would be unwise to place remote function calls behind local function call semantics. If the remote call is blocking, then I agree, but the problem is that the call blocks, not that it's a remote call looking like a local one. I'm pretty sure I can make my library function well both in non-blocking and blocking modes, but it needs to be designed from the bottom up, with that in mind, as you're saying. I'm going to be redesigning it anyway, so hopefully there will be some opportunity to get it right. /Jarl.

----- Original Message ----- From: "Jarl Lindrud" <jlindrud@hotmail.com> [snip]
[snip]
If I could reword this slightly :-) I hope I never said that blocking functions were inherently bad or in "poor style". When I think of all the banking applications written using CORBA (i.e. RPC) I dont quite feel bold enough to question the efficacy of choosing that toolset. Selection of an RPC-type mechanism for development may be a justifiable project decision. Development and maintenance may be simpler at the cost of "high-end" user feedback (e.g. wait-cursors, progress bars). Of course the decision may be wrong and the brunt of the error may be borne by the software team but that is all separate to the issue of "is blocking good or not". tioned previously in this thread as well, that it would be unwise to
Hmmmm. I suspect that procedural programming still has strong influence over the views you express. Which does not make them wrong :-) I'm not sure I can say anything useful here. Messaging allows for a responsive, two-way relationship between software components, i.e. either party may initiate a phase of activity within the wider relationship. RPC prescribes a simpler relationship and is consequently more constraining, but still perfectly justifiable. Messaging is appropriate (i.e. a necessity) at the level of actual network sends, while RPC (over a messaging lib please) may be a reasonable model for development of certain applications. In a messaging world it would not be unreasonable to hide a blocking library call behind a messaging interface. Is that now a non-blocking function?
If I have managed to contribute something then I feel great. I would be very interested to see your re-worked boost-ified rpc (esp. the internals ;-). Cheers.

Scott Woods <scottw <at> qbik.com> writes: anything else.
No that was me I think :-) But I did perceive you as criticizing RPC clients for blocking while the server is processing their request.
To me that two-way relationship is a little fragile, precisely because it's two-way. The advantage with the server/client model is that both parties know their roles, and you don't have to invent protocols to decide who should say what and when. You can implement messaging as servers sending oneway RPC's to each other, right? On the other hand, you can also implement RPC's on top of a messaging infrastructure. To me the first option looks simpler, both for the user (and the library implementer...). Not everybody wants to be a server.
At the end of the day, I guess even a RPC server is just... sending and receiving messages. It all seems to boil down to the same thing, IMO the question is more about what kind of an abstraction you want to present to the user, either client/server or server/server. Personally I'd rather go with client/server.
As you guessed I'm leaning more to the procedural side :-) But a good RPC library can cater to both camps I think. What do you see as the main advantage of basing everything around messaging, as compared to sync/async/oneway RPC's? /Jarl.

"Jarl Lindrud" <jlindrud@hotmail.com> wrote in message news:loom.20050308T150947-455@post.gmane.org...
Wouldn't it be "better" to build the foundation on non-blocking (or preferrably, asynchronous) I/O? Implementing a blocking/synchronous communications layer on top of that should be a lot easier than the other way around. I realize that this would decrease the performance soemwhat for the blocking mode, but if you're after performance you're very likely to go for async I/O anyway. As for messaging vs RPC, I think the same thing applies; it is easier to build an RPC layer on top of messaging than the other way around. OTOH, carefully designing interfaces for remoting from the start makes it possible to achieve good performance with RPC as well (and they are likely to reflect the fact that the are intended to be remoted). Just another 0.02EUR. // Johan

Johan Nilsson <johan.nilsson <at> esrange.ssc.se> writes:
Wouldn't it be "better" to build the foundation on non-blocking (or preferrably, asynchronous) I/O?
It sure would.
Agreed, async is the natural way to do socket i/o. Like you say its trivial to implement blocking functionality on top of non-blocking, and a lot less trivial than doing it the other way around.
As for messaging vs RPC, I think the same thing applies; it is easier to build an RPC layer on top of messaging than the other way around.
If you have oneway RPC's, why would it be difficult to build messaging on top of that? The two seem to me to be almost the same thing. /Jarl

On Wed, 9 Mar 2005 08:45:52 +0000 (UTC), Jarl Lindrud <jlindrud@hotmail.com> wrote:
Messaging is often built on top of a broadcast or multicast transport, so one does not need to locate or connect to a remote endpoint in order to publish messages. I don't think one-way RPCs are an adequate replacement for publish-subscribe semantics like these if you have a large fanout. -- Caleb Epstein caleb dot epstein at gmail dot com
participants (7)
-
Caleb Epstein
-
Iain Hanson
-
Jarl Lindrud
-
Jeff Garland
-
Johan Nilsson
-
Scott Woods
-
Steven E. Harris