demexp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Demexp-dev] Some questions about the code.


From: Serge Leblanc
Subject: Re: [Demexp-dev] Some questions about the code.
Date: Sun, 24 Oct 2004 19:58:39 +0200

On Sun, 2004-10-24 at 16:38 +0200, David MENTRE wrote:
Hello Serge,

Serge Leblanc <address@hidden> writes:

>      1. Why the corollary function start_server of stop_server wasn't
>         creates ? That would make the possibility from a client having
>         administration rights to initialize server.

I don't understand. If you don't have a process to answer RPCs, you
can't handle a start_server() method. To start a server, you need an
external program, typically a shell script in /etc/init.d/, to start
your daemon (much like an apache web server for instance).

I suggest that the initialization of the structures;  participant , delegation, classification, position are gathered in a function being able a RPC. During the launching of the server this RPC function can be running by a dunny client. All that to allow a remote hot-init by a start_server call.

>      2. To be useful the function save_binary_base must be to call after
>         each change of state of the structures that she save.

This was done in v0.1. I probably erased the code when migrating to the
use of full fledge RPC.

>         But this
>         function also lock the writing in the structures ; delegation,
>         classification, position with the risk of blocking all during a
>         full use.

This code was written at at time (v0.1) where the server was
multi-threaded. At that time, the locking mechanism was designed to
avoid deadlocks (that's why all bases are locked in writer mode). 

The server is no longer multi-threaded so all that locking code should
go away (I've only kept it because it breaks my heart to throw away code
:).

>          Would it be better to fulfill a save function for each
>         structure?

Well, I don't see a real need to have per structure save function. At
least, all that code is concentrated in one function. But it might be
more useful for XML save/restore.

But to be honest, I don't like this saving in binary format. It is
unreadable and is not portable from one release to the next one. That's
why we have decided to handle saving in XML format.


You wrote in documentation :
"In other words, the binary saving of databases is used only for a local use and not for long term storage of databases."

I thought that this function has a significant role in the guarantee of the persistency of information during a server crash. In this case the use of binary was suitable.


--
pub  1024D/73791C2B 2002-09-30 Serge Leblanc <address@hidden>
 Primary key fingerprint: 8E0C 0D6D E026 A278 9278  BF4F 1A93 D552 7379 1C2B

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]