Skip navigation.
Home
The QNX Community Portal

View topic - What do u thing about the Select() Function ???

What do u thing about the Select() Function ???

For discussion of realtime and/or embedded programming.

What do u thing about the Select() Function ???

Postby robert » Fri Apr 04, 2003 7:13 am

Subject: What do u thing about the Select() Function ???

hello guys,

Maybe, when i want to use the recv() function, i've got the problem that my prozess is blocket. (its only a sample, not the problem)

And when i want to avoid this i can use for example the alarm() function.

Or i can take the Select() function.
But i have haerd that the Select function is not good for a realtime prozesses.
Is it true ???[/i]
robert
Active Member
 
Posts: 15
Joined: Thu Aug 01, 2002 1:42 pm
Location: Germany

Postby cdm » Fri Apr 04, 2003 6:30 pm

Well, select() is a rather expensive call on QNX. I wouldn't say you couldn't use it for realtime work, you just have to be aware that there is some overhead and if you can live with that overhead you will be fine.

Generally I use threads instead of using select().
cdm
QNX Master
 
Posts: 789
Joined: Fri Jul 05, 2002 9:38 am

Postby xtang » Tue Jul 29, 2003 6:09 pm

Or, you can, of cause, open the fd (or use ioctl to set) O_NONBLOCK, you recv()
would come back with a EWOULDBLOCK if there is no data for you.
xtang
QNX Master
 
Posts: 313
Joined: Thu Jul 18, 2002 5:01 pm


Return to Realtime and Embedded

Who is online

Users browsing this forum: No registered users and 2 guests