When using read call for pipe, takes long time???

Support for *nix systems, apache, mysql, etc

Moderator: 127.0.0.1

When using read call for pipe, takes long time???

Postby masxer » Tue Dec 11, 2007 8:14 am

When I use a read call reading from a pipe, the read takes a long time to
return.

Why does this happen?

Thanks
masxer
n00b
n00b
 
Posts: 3
Joined: Tue Dec 11, 2007 8:12 am

Postby 127.0.0.1 » Thu Dec 13, 2007 5:37 pm

Pipes are buffered. The reader will have to wait until the
pipe is full before anything falls out the end. You may be
able to use setbuf() after creating the pipe to turn off
buffering.
User avatar
127.0.0.1
Mod
Mod
 
Posts: 1200
Joined: Sun Aug 15, 2004 11:07 pm
Location: East Lansing, MI


Return to Unix/Linux

Who is online

Users browsing this forum: No registered users and 3 guests

cron