> I really don't like having these fd_sets duplicated in both > net_stack_cookie and internal socket structs. > Maybe select() could share the three fd_sets bits vectors thru a > area_id + offsets, instead? I don't think that a few additional copies are reason enough for optimizing something that is not finished. > BTW, is select() supposed to be thread-safety or not? I think no posix calles are supposed to be thread save. But I suppose it must work that one thread calles select(), and and another calles write() or something like this. This means that you have to properly lock and unlock internal data. Marcus