Skip to contentSkip to conversation

Possible bug: ASYNC IO with RT Signals in threaded application doesnt work

PATCH Bharath Ramesh 1 participant 1 message Mar 24, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

I have a multithread application which uses ASYNC IO but is RT signal driven. I have a worker thread which handles all connection and accepts all data that are received. I use SIGRTMIN as the signal to be delivered whenever my socket is ready with data. All my threads block SIGRTMIN including the main thread. In the worker thread I have something like this

while (1) {
sigwaitinfo ();
...
...
...
}

I am never able dequeue SIGRTMIN from the pending signal queue from the worker thread. If I do the above in the main thread then I am able dequeue SIGRTMIN from the pending signal queue.

Is this a bug in the kernel or is it a feature. I am also attaching a patch along with this email which solves the ASYNC IO problem with RT signals.

Thanks,

Bharath

---
Bharath Ramesh <[email protected]> http://csgrad.cs.vt.edu/~bramesh

fs/fcntl.c renamed from fs/fcntl.c.orig +1 -1
@@ -469,7 +469,7 @@ static void send_sigio_to_task(struct ta
 			else
 				si.si_band = band_table[reason - POLL_IN];
 			si.si_fd    = fd;
-			if (!send_sig_info(fown->signum, &si, p))
+			if (!send_group_sig_info(fown->signum, &si, p))
 				break;
 		/* fall-through: fall back on the old plain SIGIO signal */
 		case 0: