一応 select(2) も読んであったので説明しとく。 メインループは非常に短いので抜粋。ここにはビットマップの転送処理は含まれていないので注意。max_select_fd() の前後が rcu_read_lock() と rcu_read_unlock() で囲まれているのは、ドキュメント (Documentation/filesystems/files.txt) によると 2.6.12 から RCU をファイルディスクリプタテーブルで利用するようになったため。以前は単なるロックだった。 int do_select(int n, fd_set_bits *fds, s64 *timeout) { struct poll_wqueues table; poll_table *wait; int retval, i; rcu_read_lock(); retval = max_select
![select のなかみ - moriyoshiの日記](https://cdn-ak-scissors.b.st-hatena.com/image/square/cdd4b1d0fe6476244636366aad1944fde9810d9b/height=288;version=1;width=512/http%3A%2F%2Fcdn-ak.f.st-hatena.com%2Fimages%2Ffotolife%2Fm%2Fmoriyoshi%2F20090521%2F20090521061911.png)