<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>yupo5656</author_name>
  <author_url>https://blog.hatena.ne.jp/yupo5656/</author_url>
  <blog_title>memologue</blog_title>
  <blog_url>https://yupo5656.hatenadiary.org/</blog_url>
  <categories>
    <anon>C++</anon>
  </categories>
  <description>googleから私の日記に、localtime_r や strtok_r, getpwnam_r などのキーワードで飛んでくる方が結構多いので、ちょっと関連する話題を書いてみます(内容の割に長い…)。 さて、8/9の日記で、POSIXのlocaltimeという関数(下記)を取り上げ、 struct tm *localtime(const time_t *timer); この関数を複数のスレッドが同時に使うと処理が破綻すると書きました。また、この関数はシグネチャが腐っているので、libcの外側でmutexを使っても処理の破綻を回避することはできず、localtime_rという代用関数を使うしかな…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fyupo5656.hatenadiary.org%2Fentry%2F20040909%2Fp1&quot; title=&quot; localtimeやstrtokは本当にスレッドセーフにできないのか (1) - memologue&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>2004-09-09 00:00:00</published>
  <title> localtimeやstrtokは本当にスレッドセーフにできないのか (1)</title>
  <type>rich</type>
  <url>https://yupo5656.hatenadiary.org/entry/20040909/p1</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
