optionally nonblocking