[Verse-dev] Performance

Eskil Steenberg eskil at obsession.se
Fri Jun 10 17:31:22 CEST 2005


Hi

> I think you misunderstood my attempt of explanation... ;)
> I didn’t mean that you are sending every verse command directly to the
> network... that would not be very usable, I agree.
> What I wanted to express is, that you have to different mechanisms for
> sending and receiving. Callback_update gets the commands from the
> network and routes it to the callback functions and the commands sent to
> verse are handled by another function.

I get what you say but i you couldent realy de couple the send and reseve
code. Thees two modules comunicates a lot so even if you have one mutex
for send ing and one for receving, sending a command might look up
receving and the other way around.

> Yesterday I started to write some kind of wrapper before verse, that
> encapsulated all verse commands and the callback_update command a mutex
> every time they are called. I did it just for very few commands and have
> to test it but it seems to work that way. Probably not the most elegant
> way and probably not the fastest but it will work for now and make verse
> - if it's running as I suppose it to run - multithreaded accessible.
> The only thing I'm doing there is wrapping a mutex around the
> verse_send... command and unlocking the mutex until the sending is done.
> I don’t know how much time I can spend on this today but hopefully I
> will finish this and test it a little bit...

That would be the straight forward way of mutex securing verse.

But i would sugest dopping multi treading completely. Here is what i would
do:

I would take the server code and i would modefy it so that there would be
one connection that would be a "master connection" that would be
initialized at start up. this would make the server a client for this
connection and a host for all other connections.

If this master conection would atempt to update the data in the server it
would always be alowd to do so (the cilent has to obay the host) and any
change would be sent out to all other subscribing clients. the Master
client would subscribe to all data from the host its connected to.

The normal clients would no longer be alowed to change the data, but they
would be alowed to subscribe to it. Any time a client would reqest a
change to the data it would be sent along to the master connection.

This way you could connect this server to a normal verse server and
everything that would be done in this "sub server" would be cleared by the
host server. Then you could build hirarcical setups that wouldent be
confined to just one machine like a treaded app would be. I think it would
be simpler and much more flexible to do.

E






More information about the Verse-dev mailing list