[okl4-developer] A doubt about blocking receive
Kalamkar, Dhiraj D
dhiraj.d.kalamkar at intel.com
Thu Aug 30 20:23:30 EST 2007
Hello Matthew,
Thanks for your quick reply.
I came to same conclusion when saw that blocked threads' information is
kept in receiver's queue.
Anyway, here is the situation I am trying to fix:
I have created a communication service (comms service) on iguana similar
to naming service. This service acts as a router for my applications.
Thread A1 allocates a buffer and provides read/write access to comms
service. Now whenever A1 wants some service from comms, it provides
address of shared buffer to comms. In normal case it works fine. Problem
comes when A1 misbehaves or comms service got with an irrecoverable
error while serving to A1.
If A1 sends comms service some arbitrary address to which comms service
does not have access, comms service gets an invalid page fault and
iguana server kills it. I need a way to avoid/handle this page fault and
send error reply to A1. The other thing is, there might be other threads
A2, A3... waiting reply from comms service. In case comms service
terminates because of error, I want A2, A3... come out of blocked state
and recover some how.
Also, I would like to know how to use timer service for implementing
timeout. And is it possible to use with stub generated using IDL4?
Thanks once again,
Dhiraj Kalamkar
-----Original Message-----
From: Matthew Warton [mailto:mwarton at ok-labs.com]
Sent: Thursday, August 30, 2007 1:09 PM
To: Kalamkar, Dhiraj D
Cc: developer at okl4.org
Subject: Re: [okl4-developer] A doubt about blocking receive
Hi Dhiraj,
You are correct in this case, t1 will remain blocked waiting for t2,
even if t2 is deleted. However, If t1 was blocked sending to t2, it
would be aborted and returned failure. The reason for the difference
is that the kernel does not internally track waiters on a specific
thread.
If you really need t1 to be woken up in this case (ie it is not a
bug, but a normal operation of the system that this should happen),
you should request a timeout from the timer server before doing the
call that is expected to fail, and ensure that you use an IPC where
you may receive from multiple threads.
Can you give us more details on the particular problem this is causing?
Thanks,
Matthew Warton
On 30/08/2007, at 1:25 PM, Kalamkar, Dhiraj D wrote:
> Hi,
>
>
>
> Suppose a thread t1 is blocked on receive IPC operation and waiting
> message from thread t2. Meanwhile, t2 exits without doing send IPC
> to t1 or terminated by pager because of invalid page fault before
> doing send operation. Does it abort t1's IPC receive and returns
> failure or t1 remains blocked?
>
>
>
> Thanks,
>
> Dhiraj
>
> _______________________________________________
> Developer mailing list
> Developer at okl4.org
> https://lists.okl4.org/mailman/listinfo/developer
More information about the Developer
mailing list