kaio
[Top] [All Lists]

Finally got things right... ;-) (signals & threads in LInux)

To: kaio@xxxxxxxxxxx
Subject: Finally got things right... ;-) (signals & threads in LInux)
From: Christopher Smith <x@xxxxxxxx>
Date: Mon, 02 Apr 2001 18:53:22 -0700
Sender: owner-kaio@xxxxxxxxxxx
Hey there! I've been playing around with KAIO for a while now, and I've been somewhat frustrated with it. Not so much because of shortcomings in KAIO itself, but with the Linux kernel.

One of the annoying things about using KAIO (or any other poll/signal approach to IO) is that you'd really like it if a thread B could receive the signal indicating completion of an I/O request posted by thread A. Realtime POSIX extensions and POSIX threads make this possible with AIO, but unfortunately Linux's implementation of threading causes a signal to always be returned to the invoking thread.

To make it clear what I'm trying to accomplish I've included a really basic test program which demonstrates how things are supposed to work (it should work on a POSIX compliant OS, but it won't work on standard Linux with the KAIO patch). Please excuse all the commented code as I've been experimenting with Linux's broken thread implementation.

Right now I've got this working by doing a small hack to the 2.4.3 kernel and the KAIO code. I'm going to tidy this up and maybe move part of the fixing into LinuxThreads (right now LinuxThreads does not use the new CLONE_THREAD flag and it should). Either way the patch is a complete hack, but it does serve as a demonstration of how efficient this code could be.

--Chris

Attachment: test.c
Description: Text Data

<Prev in Thread] Current Thread [Next in Thread>