[Spread-users] Threading of spread daemon

Muthal Sangam sangam at mail.ru
Thu Jun 13 10:24:16 EDT 2002


Hi all,

I am interested in implementing a distributed lock manager and other tricky 
distributed services using spread. But these services are meant to be used from
inside a unix kernel :-)  There are differences in the runtime environment,
regarding
which i need some help/guidance.

I understand spread's present architecture as follows
A spread thread(process) does SERIALLY & IN THE ORDER DESIRED, 
1. Protocol processing 
2. Handling requests from apps ( join/send )
3. Queing of events to apps (message recv/ leave events)

Applications queue requests and read events from a bi-directional stream socket.
When there are no events, they will block. Multiple threads in a single
application
process sharing a group under one process name are protected against 
inconsistent actions of each other in the thread safe user library via locks.

Now, inside the kernel there is no need to use a stream socket to communicate
between spread's thread and the application (the code of both being now inside
the kernel). So this means,

1.  instead of queing requests to spread, in principle the desired
actions can be directly invoked by the application. 
2.  Whenever an event occurs that, the application has to be notified, the app
can be directly called and given a ptr to the message.

In the case of 1, it means that application will call in arbitrarily to what
the spread 
thread was currently doing. It can even be going on concurrently if there are 
multiple cpus. Can i approach this problem by not allowing app calls until its
"SAFE" to do so, by means of locks. Both the spread thread and the application
threads that request will serialize on some big lock. This makes the order of
calling non-deterministic ( i think there is some priority in handling events),
as
we cant say who will get the lock. Does it matter here ?

In the case of 2, when the appcode is directly called, it can sometimes call
back
with requests!, will this re-enterancy be safe ?!

Thanks in advance
- sangam






More information about the Spread-users mailing list