with blocking and non-blocking