[coyotos-dev] Thoughts on FCRBs and asynchrony

Christopher Nelson paradox at BBHC.ORG
Wed Feb 8 15:03:56 EST 2006

> Christopher Nelson wrote:
> >> If your activation handler accesses application state, then yes.
> >>
> >>Generally, I think activation handlers will be provided by 
> libraries 
> >>(such as user-level threads, event loops, etc.), in which case they 
> >>can be somewhat isolated from your data.
> >>    
> >>
> >
> >I don't think this makes sense at all.  Unless, for example, 
> libraries 
> >all have their own allocator.  There is certain global state 
> that must 
> >change atomically and not be cached (i.e. in stored 
> registers), so any 
> >sort of concurrency still has to be managed.
> >  
> >
> As Shap mentioned, a light "activation thread" to push events 
> onto a synchronized queue, and the main application thread to 
> pull events from the queue and process them. The only 
> synchronization point is in the queue itself. This is what I 
> meant by your data being isolated. The library may or may not 
> require an allocator (a fixed length event queue provided by 
> a client at initialization is certainly possible for instance).

 I see what you're saying.  Essentially it would be a simple thread

Queue* top;
Queue* empty_items;

void post_event(event)
	Queue *qi = atomic_list_pop(empty_items);


More information about the coyotos-dev mailing list