<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>ema_hiro</author_name>
  <author_url>https://blog.hatena.ne.jp/ema_hiro/</author_url>
  <blog_title>emahiro/b.log</blog_title>
  <blog_url>https://ema-hiro.hatenablog.com/</blog_url>
  <categories>
    <anon>Go</anon>
  </categories>
  <description>Overview sync package 内にある semaphore を使って Go のアプリケーション側で goroutine の起動数を排他制御します。 Go の並行処理の起動数を制御するのは 使い方 https://pkg.go.dev/golang.org/x/sync/semaphore#section-documentation のサンプルにある実装方法に準拠するだけでOKです。 // goroutine の上限を指定する。 var maxConcurrentNum int64 = 20 sem := semaphore.NewWeighted(maxConcurrentNum…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fema-hiro.hatenablog.com%2Fentry%2F2024%2F08%2F12%2F154543&quot; title=&quot;semaphore を使って goroutine の起動数を Go から排他制御する - emahiro/b.log&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2024-08-12 15:45:43</published>
  <title>semaphore を使って goroutine の起動数を Go から排他制御する</title>
  <type>rich</type>
  <url>https://ema-hiro.hatenablog.com/entry/2024/08/12/154543</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
