Hacker News new | ask | show | jobs
by fractaled 4023 days ago
Setting up the wait for 10k file descriptors will still be O(n), the actual wait is O(1). And presumably you're waiting many times, and not changing which 10k files you're polling for each wait. Each wait is O(1) because the kernel just calls you back when your wait is satisfied -- it associates a list of waiters for each file descriptor.