I know that it's bad to run any kind of GUI widget from within a separate thread. For just messages, this can be overcome with signals to the main thread. But what if the thread needs a user input, how can the answer be signaled back to the thread and how can that thread wait for that answer?
My particular case is an application that uses sftp from libssh. During connection and authentication, the user may need to answer one or more questions. But for performance reasons, all the SSH/SFTP stuff must be running in a separate thread.