GnuCash Daily Source Diff
Derek Atkins
warlord@MIT.EDU
05 Oct 2001 12:48:54 -0400
In my particular case I had to use multi-threaded applications because
of blocking semantics of RPC. Because RPC is necessarily
single-threaded (and the GnuCash backend is necessarily
single-threaded), I actually needed to use threads in order to provide
a single-threaded appearance.
I can go into the gory details if you'd like, but suffice it to say
that in the client the extra thread is the network-reader and in the
server each client connection gets its own thread. This is why it
would be nice to be able to have a separate "engine state" (read:
session) for each connected client :)
-derek (who also likes to get in the last word ;)
PS: I do believe it is possible to create a client-server application
purely using events, but you have to design that into the system from
the ground up.
linas@linas.org (Linas Vepstas) writes:
> Hi,
> Wherein I show my penchant for get-the-last-word-in-ism:
>
> On Fri, Oct 05, 2001 at 11:27:14AM -0400, Derek Atkins was heard to remark:
> >
> > Actually the RPC Server is multi-threaded.
> > The reason it's done this way is that ....
>
> Whenver one writes a server that is doing network communications
> with multiple clients, its *always* easier to make it multi-threaded.
> If you try to write a single-threaded server, and try to handle your
> own socket polling and dispatching, then you are doomed to re-invent
> threads, badly, whether you are aware of it or not.
>
> --linas
>
> --
> pub 1024D/01045933 2001-02-01 Linas Vepstas (Labas!) <linas@linas.org>
> Key fingerprint = 8305 2521 6000 0B5E 8984 3F54 64A9 9A82 0104 5933
--
Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
Member, MIT Student Information Processing Board (SIPB)
URL: http://web.mit.edu/warlord/ PP-ASEL-IA N1NWH
warlord@MIT.EDU PGP key available