GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    luna, only carbon now (luna@pony.social)'s status on Monday, 10-Mar-2025 21:24:35 JST luna, only carbon now luna, only carbon now

    questions that can really derail a sunday evening:

    is std::cout thread-safe?

    (not in the way you'd want it to be, no)

    In conversation about 3 months ago from pony.social permalink
    • Haelwenn /элвэн/ :triskell: and Doughnut Lollipop 【記録係】:blobfoxgooglymlem: like this.
    • Rich Felker, Haelwenn /элвэн/ :triskell: and Doughnut Lollipop 【記録係】:blobfoxgooglymlem: repeated this.
    • Embed this notice
      luna, only carbon now (luna@pony.social)'s status on Monday, 10-Mar-2025 21:24:37 JST luna, only carbon now luna, only carbon now
      in reply to

      Consider this code. One thread repeatedly prints the number 100 in decimal to std::cout. Another thread repeatedly prints the number 0x100 in hex (which will output as '100') to std::cout.

      You might reasonably expect that the output will simply be '100' over and over and over.

      Unfortunately, the calls to operator<< can get interleaved so you end up with crosstalk of the format specifiers:

      In conversation about 3 months ago permalink

      Attachments


      1. https://cdn.pony.social/media_attachments/files/114/134/054/354/023/304/original/2c49e257569e36c5.png

      2. https://cdn.pony.social/media_attachments/files/114/134/073/333/013/689/original/c00df8fd94028327.png
      Doughnut Lollipop 【記録係】:blobfoxgooglymlem: likes this.
    • Embed this notice
      Rich Felker (dalias@hachyderm.io)'s status on Monday, 10-Mar-2025 21:25:48 JST Rich Felker Rich Felker
      in reply to

      @luna The whole modal formatting thing is gratuitously stupid. It's slower, uglier, and had awful gotchas like this compared to printf.

      In conversation about 3 months ago permalink
    • Embed this notice
      Steve Canon (steve@discuss.systems)'s status on Monday, 10-Mar-2025 22:53:06 JST Steve Canon Steve Canon
      in reply to
      • Josh Simmons

      @dotstdy @luna iostream formatting is the most clown-shoes misfeature in the whole clown-shoes language.

      In conversation about 3 months ago permalink
    • Embed this notice
      Josh Simmons (dotstdy@mastodon.social)'s status on Monday, 10-Mar-2025 22:53:07 JST Josh Simmons Josh Simmons
      in reply to

      @luna tfw you're not even better than printf on any axis

      In conversation about 3 months ago permalink
      Rich Felker repeated this.
    • Embed this notice
      Graham Sutherland / Polynomial (gsuberland@chaos.social)'s status on Tuesday, 11-Mar-2025 02:24:01 JST Graham Sutherland / Polynomial Graham Sutherland / Polynomial
      in reply to

      @luna it's thr safead

      In conversation about 3 months ago permalink
      Doughnut Lollipop 【記録係】:blobfoxgooglymlem: likes this.

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.