serial programming, C/C++ Programming

HiI''m trying to connect to CISCO router using termios. So I decided to have two threads one for reading data and the other one for writing data. The problem is that I have to add at least an usleep(70000) command after writing to the port otherwise the output would not be what I expect. Without this usleep command, every character I type, the output is shown with next character not at time :

Router>Router>abc // While I typed "abcd". If I continue with typing "e", then the output will be "abcd" and so on ...

How can I fix this? If the code is needed please tell me to send it for you.Please help me.Thanks