crazyguitar | 1 month ago | on: Show HN: C/C++ Cheatsheet – a modern, practical reference for C and C++
crazyguitar's comments
crazyguitar | 1 month ago | on: Show HN: C/C++ Cheatsheet – a modern, practical reference for C and C++
crazyguitar | 6 years ago | on: A Hitchhiker’s Guide to Asynchronous Programming
Also, I did not advocate a newbie should start and stop threads by themselves. I want to say I agree that we should use high-level APIs in most cases, but, in some cases, we may need to use low-level APIs to achieve our missions. I am unwilling to limit what kind of APIs should use. In my opinion, like you said: "you have just seriously over-architected the solution," we should be careful to use APIs. Even though high-level APIs are safer, programmers may misuse them.
crazyguitar | 6 years ago | on: A Hitchhiker’s Guide to Asynchronous Programming
crazyguitar | 6 years ago | on: A Hitchhiker’s Guide to Asynchronous Programming
However, I don't think use threads/processes is a bad idea. A pool gives you a constrain to utilize threads/processes, but sometime we may want to adjust the number of threads/processes based on system load. Under this circumstance, using a pool is not the best choice.
crazyguitar | 6 years ago | on: A Hitchhiker’s Guide to Asynchronous Programming
However, using `@coroutine` + `yield from` means we transform a generator into a generator coroutine. Because a generator is a form of coroutine, in Python 3.4, `@coroutine` turns a function or a future into a generator function. Note that if a function is a generator function, `@coroutine` does not do anything. Based on the document, Python recommends using `async def` instead of `@coroutine` to declare a coroutine because `@coroutine` will be removed in Python 3.10.
crazyguitar | 6 years ago | on: A Hitchhiker’s Guide to Asynchronous Programming
crazyguitar | 6 years ago | on: A Hitchhiker’s Guide to Asynchronous Programming
crazyguitar | 6 years ago | on: A Hitchhiker’s Guide to Asynchronous Programming
crazyguitar | 6 years ago | on: A Hitchhiker’s Guide to Asynchronous Programming
crazyguitar | 6 years ago | on: A Hitchhiker’s Guide to Asynchronous Programming
crazyguitar | 6 years ago | on: A Hitchhiker’s Guide to Asynchronous Programming
crazyguitar | 6 years ago | on: A Hitchhiker’s Guide to Asynchronous Programming
crazyguitar | 6 years ago | on: A Hitchhiker’s Guide to Asynchronous Programming