<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>qnzm</author_name>
  <author_url>https://blog.hatena.ne.jp/qnzm/</author_url>
  <blog_title>qnzm.log(クニジマログ)</blog_title>
  <blog_url>https://qnzm.hatenadiary.org/</blog_url>
  <categories>
    <anon>ruby</anon>
    <anon>マルチスレッド</anon>
  </categories>
  <description>マルチスレッドパターン続き。 終了要求をうけ終了する前に、「終了状態」を挟むことによって安全性、生存性、応答性を確保しようというパターン。 今回はjavaのThread#interruptにあたるrubyのメソッドが見あたらなかったので、本とは少し異なったイメージになっています。 サンプルプログラム:ロガー サンプルとして乱数をログ出力し続けるスクリプトを作ります。 これは0〜9の数字から乱数をとり、ログ出力するもので、フォーマットは &lt;&lt;[タイムスタンプ]&gt;&gt; [生成した乱数] --------------にしたいとします。 また、乱数アウトプットと罫線を引く部分の間にはsleepを入れてい…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fqnzm.hatenadiary.org%2Fentry%2F20080209%2F1202524095&quot; title=&quot;Two-Phase Termination - qnzm.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>2008-02-09 11:28:15</published>
  <title>Two-Phase Termination</title>
  <type>rich</type>
  <url>https://qnzm.hatenadiary.org/entry/20080209/1202524095</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
