Slide 9 of 16
EXAMPLE: Browsers used multiple TCP/IP connections to overcome 3xRTT (approx) setup latency; directory scanning algorithms can run many times faster even within one partition allowing better queueing of disk activity in OS.
Lock granularity: bigger locks and around code rather than data tend to easier to program and less error-prone but may reduce concurrency; finer-grained data-based locks may proved better if so. You usage patterns will determine this.
- What is/are your main reason(s) for threading?
- Can you test results of your tinkering on your target system?
- Do you have multiple targets to optimise for some combination of?
Interrupts can be very expensive, eg for high-speed serial I/O; Sun uses combination of interrupts and polling for serial I/O. Strange effects on serial-connected clocks and NTP timekeeping, eg DHD Arcron code.
Interrupt code may be a special flavour of thread on some systems.