add 'readwrite_task' function to read keyboard input