delvingbitcoin

BIP324 Proxy: easy integration of v2 transport protocol for light clients (PoC)

BIP324 Proxy: easy integration of v2 transport protocol for light clients (PoC)

Original Postby yonson

Posted on: April 15, 2024 17:35 UTC

The discussion revolves around the implementation of asynchronous operations, specifically highlighting the use of "spawning" as a method to create new threads of work.

These aren't traditional threads directly mapped to the operating system's threads but are instead "green threads," which are managed by the language runtime rather than the operating system. This distinction is crucial for understanding how concurrency is achieved in this context without the direct overhead associated with operating system threads.

Moreover, there is an exploration of transitioning towards an operating system thread implementation. This approach is contrasted with the asynchronous model, where the emphasis is on utilizing standard library wrappers that are compatible with the std::io::Read/Write traits. Such traits typically face compatibility issues within asynchronous environments, suggesting a trade-off when considering this implementation strategy. The advantage of moving towards an OS thread implementation lies in its simplicity and straightforward coding model. However, this comes at the expense of increased resource consumption per connection, indicating a significant cost associated with this simplicity. The narrative thus navigates through the complexities and trade-offs between using green threads for asynchronous programming and the potential shift towards a more traditional threading model based on operating system threads.