<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
        <title>Goroutine - Tag - Luân Dương</title>
        <link>http://localhost/tags/goroutine/</link>
        <description>Goroutine - Tag - Luân Dương</description>
        <generator>Hugo -- gohugo.io</generator><language>en-us</language><managingEditor>luandnh98@gmail.com (Dương Nguyễn Hoàng Luân)</managingEditor>
            <webMaster>luandnh98@gmail.com (Dương Nguyễn Hoàng Luân)</webMaster><lastBuildDate>Mon, 25 Aug 2025 10:00:00 &#43;0700</lastBuildDate><atom:link href="http://localhost/tags/goroutine/" rel="self" type="application/rss+xml" /><item>
    <title>Quản lý goroutine: errgroup, leak-proof, backpressure</title>
    <link>http://localhost/posts/quan-ly-goroutine/</link>
    <pubDate>Mon, 25 Aug 2025 10:00:00 &#43;0700</pubDate>
    <author>luandnh98@gmail.com (Dương Nguyễn Hoàng Luân)</author>
    <guid>http://localhost/posts/quan-ly-goroutine/</guid>
    <description><![CDATA[<h2 id="mở-đầu">Mở đầu</h2>
<p>Goroutine là món &ldquo;shot espresso&rdquo; của Go: nhẹ, rẻ, bật là chạy. Mỗi goroutine chỉ tốn ~2KB stack ban đầu — so với ~1MB của OS thread, bạn có thể chạy hàng trăm ngàn goroutine trong một tiến trình. Nhưng nếu rót liên tục mà không kiểm soát, bạn sẽ có một quầy pha chế quá tải, chảy tràn và khách chờ dài cổ.</p>
<p>Bài này chia sẻ cách tôi quản lý goroutine ở những dịch vụ có tải cao: dùng errgroup để phối hợp và huỷ đồng loạt; thiết kế leak-proof để không rò rỉ; và áp dụng backpressure để bảo vệ tài nguyên. Không lý thuyết suông — mỗi pattern đều có nguyên nhân từ kinh nghiệm thực tế.</p>]]></description>
</item>
</channel>
</rss>
