CSC209H1 Lecture Notes - Lecture 10: Bitwise Operation, Ampersand, Operand

80 views7 pages
School
Course
Professor

Document Summary

0b00010011: you can also use hexadecimal constants, prefaced with 0x, ex. If we use each bit in a variable to denote the presence -- or absence -- of a particular element in the set, then we have a very compact implementation that can use fast boolean instructions as set operations. This macro initializes the set of descriptors to be empty. Only contain the file descriptors that are ready: so we need to use another set operation - checking set membership - to determine which descriptors remain in the set. The macro fd_isset takes a single fd and returns whether or not it is in the fdset pointed to by the second parameter. So in our case, we want to know if the pipe from child 1 is in read_fds after the select call. If it *is* in the set, then we know that this pipe is ready, so we can read from it without fear of blocking.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents