I have bitten by this quite a few times before, so let me just share my experiences.
. It may not work properly in Windows especially if you're inside a GUI loop.(WxWidgets, Tk, Win32,...) Still worth a try. It has a beautiful interface and in most cases it will not block your program.
Another solution I have applied in the past came from BrowserUK. This is using the notorious threads but BrowserUK transforms it into a true work of art: