جميع الكتب

مهني

1 Markets I: The Ecosystem and Exchange-Traded Marketsالأسواق عبر الإنترنت 2 Markets II: Rates, FX and Creditالأسواق عبر الإنترنت 3 Markets III: Commodities, Energy and Cryptoالأسواق عبر الإنترنت 4 Quantitative Methodsالأساليب عبر الإنترنت 5 Derivatives and Volatilityالمشتقات عبر الإنترنت 6 Rates, Credit, XVA and Riskالفائدة والائتمان والمخاطر عبر الإنترنت 7 Research Craft: Predictors, Backtests, Measurement, Portfoliosالبحث عبر الإنترنت 8 Strategies I: Equities and Futuresالاستراتيجيات عبر الإنترنت 9 Strategies II: Volatility, Relative Value, Macro and the Bank Desksالاستراتيجيات عبر الإنترنت 10 Microstructure and Executionالتنفيذ عبر الإنترنت 11 Market Making and High-Frequency Tradingصناعة السوق عبر الإنترنت 12 Machine Learning for Marketsتعلم الآلة عبر الإنترنت 13 Low-Latency Softwareالتكنولوجيا عبر الإنترنت 14 Networks, Hardware and Trading Infrastructureالتكنولوجيا عبر الإنترنت 15 Research, Data and Risk Platformsالتكنولوجيا عبر الإنترنت 16 The Desk and the Firmالشركة عبر الإنترنت 17 The Industry: Firms, Roles and Careersالمسارات المهنية عبر الإنترنت 18 The Interview Bookالمسارات المهنية عبر الإنترنت
التطبيقات حول المدرب تسجيل الدخول ابدأ القراءة

Quantitative Finance · المسرد

ما معنى Context switch, busy polling, kernel bypass؟

يُعرف أيضًا باسم: context switch · busy polling · kernel bypass

Definition 13.5 Low-Latency Software · الفصل 13 — Linux Tuning

A context switch is the kernel saving the state of the thread running on a CPU and restoring another’s; a thread that blocks waiting for data gives its CPU away and is switched back in when the data arrives. Busy polling checks for new data in a loop that never blocks, keeping the CPU. Kernel bypass moves the network card’s receive and transmit queues into the application’s address space, so that packets reach the program without a system call, an interrupt or the kernel’s network stack.

Three ways for a packet to reach a thread. Left: the card interrupts a CPU, the kernel processes the packet, and the sleeping thread is switched back in. Middle: the thread never sleeps and polls the socket. Right: the card writes into queues mapped into the program, which polls them; the kernel is not on the path (DMA: direct memory access, chapter 4). Shaded red: the kernel’s work on the path.
Figure 13.3. Three ways for a packet to reach a thread. Left: the card interrupts a CPU, the kernel processes the packet, and the sleeping thread is switched back in. Middle: the thread never sleeps and polls the socket. Right: the card writes into queues mapped into the program, which polls them; the kernel is not on the path (DMA: direct memory access, chapter 4). Shaded red: the kernel’s work on the path.
Round trips of 64 bytes between two pinned threads over loopback UDP, receiving with a blocking call or with non-blocking calls in a loop, and of one byte through two pipes with both threads on one CPU or on two; 100 000 round trips each. Measured on a laptop (Intel Core Ultra 7 155H) under WSL2, no isolated cores. Data: bench_tuning.py.
Figure 13.4. Round trips of 64 bytes between two pinned threads over loopback UDP, receiving with a blocking call or with non-blocking calls in a loop, and of one byte through two pipes with both threads on one CPU or on two; 100 000 round trips each. Measured on a laptop (Intel Core Ultra 7 155H) under WSL2, no isolated cores. Data: bench_tuning.py.
اقرأ في الفصل →