If select() in the implementation of pa_poll returns an error because of an invalid socket, pa_poll tries to find out which descriptor is bad. And then retries the select. But this is still in not synchronized context. So a second descriptor may become bad on the second call to select. This is not captured. And consequently pa_poll fails and the mainloop terminates, resulting in deadlocks if further activity is on the way. It seems that I managed to trigger this problem on OS/2 from time to time when closing a pa_stream and a pa_context and opening another context at almost the same time. I would recommend to jump to the previous select() call instead of executing another one without error checking. To avoid infinite loops this should only be done if the check removed at least one descriptor. Marcel