Asynchronous Input

Top  Previous  Next

The server has no support for type-ahead, so techniques for interrupting an application by typing characters at the keyboard cannot work. If you create a thread that is always waiting for stdin, all other threads that attempt to generate output (for example, using par_printf) will be blocked.

 

The solution is to use one of the ten host semaphores maintained by the kernel. A thread can wait on one of these semaphores, numbered from 0 to 9, using the function host_sema_wait. You signal host semaphores from the Host Semaphore Toolbar, which may be enabled from the server's View menu.

 

Server_HostToolbarSelect

Server_HostToolbar