[okl4-developer] Async Message Buffers

Ryan Heffernan ryan.heffernan at nicta.com.au
Wed Jun 11 14:41:44 EST 2008


Hello,

I wanted to enquire about the status of sessions in the new 2.1 release.
In the past I have become quite familiar with Iguana sessions,
specifically using async message buffers to pass data between threads.
Simplified example (this assumes the session has been initialized
already):

********
thread1:

uintptr_t *size, *data;

size = cb_alloc(call_cb, sizeof(uintptr_t));
*size = 2*sizeof(uintptr_t);

data = cb_alloc(call_cb, *size);
data[0] = send_data1; 
data[2] = send_data2;
cb_sync_alloc(call_cb);

L4_Notify(thread2, 1);
//...

thread2_async_handler:

uintptr_t *size, *data;

size = cb_get(call_cb, sizeof(uintptr_t));
while (size) {

	data = cb_get(call_cb, *size);
	/* process data */

	cb_sync_get(call_cb);
	size = cb_get(call_cb, sizeof(uintptr_t));
}
//...

*******

The reason i was using this was because i was porting old Nicta L4 code
to OKL4 1.5.2, and the old code made heavy use of async message
buffers. 

I am going to start development on the latest OKL4 release and was
considering making use of sessions and async message buffers. Since OKL
is moving towards more capability-based protection I assumed that
sessions may be on their way out, but I wanted to check with you guys if
a) async message buffers are still supported by the new release, b)
maybe there is a better way to handle this kind of communication and c)
if I should avoid sessions altogether since this functionality is
outdated and will be replaced by something else. 

Thanks!
Ryan




More information about the Developer mailing list