[openbeosnetteam] Question...
- From: "David Reid" <dreid@xxxxxxxxxxxx>
- To: "OpenBeOS Network Team" <openbeosnetteam@xxxxxxxxxxxxx>
- Date: Wed, 20 Mar 2002 14:36:42 -0000
Sorry for so many mails today :)
So, here's the question and the background...
At present for every "device" (real or pseduo) we run 2 threads, one for rx
and one for tx. the rx one sits in a blocking read() from the device as this
stops us chewing CPU time. I'd like to have the device start/stop these
threads as if we decide to stop a device, the rx/tx threads needs to stop as
well. The question is how do we stop the threads? Sure we can just call
kill_thread() but the rx thread is in a blocking read call so it'd be nice
if we could somehow awaken that call and then somehow have the thread decide
to exit all on it's own. This could be done by checking the flags for the
interface and if it didn't have IFF_UP then the thread exits. How do we wake
it up though? The tx thread may have similar issues but I haven't really
looked at that in enough detail - though I suspect we can just kick the
queue sem and that'll do it for us.
The code concerned is in net_server/core.c and is if_rx_thread and
friends...
david
Other related posts:
- » [openbeosnetteam] Question...