mastodon.ie is one of the many independent Mastodon servers you can use to participate in the fediverse.
Irish Mastodon - run from Ireland, we welcome all who respect the community rules and members.

Administered by:

Server stats:

1.6K
active users

#C11

0 posts0 participants0 posts today
Felix Palmen :freebsd: :c64:<p>The <a href="https://mastodon.bsd.cafe/tags/lockfree" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>lockfree</span></a> command <a href="https://mastodon.bsd.cafe/tags/queue" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>queue</span></a> in <a href="https://mastodon.bsd.cafe/tags/poser" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>poser</span></a> (for <a href="https://mastodon.bsd.cafe/tags/swad" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>swad</span></a>) is finally fixed!</p><p>The original algorithm from [MS96] works fine *only* if the "free" function has some "magic" in place to defer freeing the object until no thread holds a reference any more ... and that magic is, well, left as an exercise to the reader. 🙈</p><p>Doing more research, I found a few suggestions how to do that "magic", including for example <a href="https://mastodon.bsd.cafe/tags/hazardpointers" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>hazardpointers</span></a> ... but they're known to cause quite some runtime overhead, so not really an option. I decided to implement some "shared object manager" based on the ideas from [WICBS18], which is kind of a "manually triggered garbage collector" in the end. And hey, it works! 🥳<br><a href="https://github.com/Zirias/poser/blob/master/src/lib/core/sharedobj.c" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/Zirias/poser/blob/m</span><span class="invisible">aster/src/lib/core/sharedobj.c</span></a></p><p>[MS96] <a href="https://dl.acm.org/doi/10.1145/248052.248106" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">dl.acm.org/doi/10.1145/248052.</span><span class="invisible">248106</span></a><br>[WICBS18] <a href="https://www.cs.rochester.edu/u/scott/papers/2018_PPoPP_IBR.pdf" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://www.</span><span class="ellipsis">cs.rochester.edu/u/scott/paper</span><span class="invisible">s/2018_PPoPP_IBR.pdf</span></a></p><p><a href="https://mastodon.bsd.cafe/tags/coding" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>coding</span></a> <a href="https://mastodon.bsd.cafe/tags/c" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>c</span></a> <a href="https://mastodon.bsd.cafe/tags/c11" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>c11</span></a> <a href="https://mastodon.bsd.cafe/tags/atomics" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>atomics</span></a></p>
Felix Palmen :freebsd: :c64:<p>I recently took a dive into <a href="https://mastodon.bsd.cafe/tags/C11" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>C11</span></a> <a href="https://mastodon.bsd.cafe/tags/atomics" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>atomics</span></a> to come up with alternative queue implementations not requiring locking some <a href="https://mastodon.bsd.cafe/tags/mutex" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>mutex</span></a>.</p><p>TBH, I have a hard time understanding the <a href="https://mastodon.bsd.cafe/tags/memory" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>memory</span></a> <a href="https://mastodon.bsd.cafe/tags/ordering" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ordering</span></a> constraints defined by C11. I mean, I code <a href="https://mastodon.bsd.cafe/tags/assembler" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>assembler</span></a> on a <a href="https://mastodon.bsd.cafe/tags/mos6502" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>mos6502</span></a> (for the <a href="https://mastodon.bsd.cafe/tags/c64" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>c64</span></a>), so caches, pipelines and all that modern crap is kind of alien rocket science anyways 😆.</p><p>But seriously, they try to abstract from what the hardware provides (different kinds of memory barrier instructions, IMHO somewhat easier to understand), so the compiler can pick the appropriate one depending on the target CPU. But wrapping your head around their definition really hurts the brain 🙈.</p><p>Yesterday, I found a source telling me that <a href="https://mastodon.bsd.cafe/tags/amd64" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>amd64</span></a> (or <a href="https://mastodon.bsd.cafe/tags/x86" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>x86</span></a> in general?) always has strong ordering for reads, so no matter which oderding constraint you put in your atomic_load and friends, the compiler will generate the same code and it will work. Oh boy, how should I ever verify my code works on e.g. aarch64 without owning such hardware?</p>
Felix Palmen :freebsd: :c64:<p>Hm, is <a href="https://mastodon.bsd.cafe/tags/valgrind" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>valgrind</span></a>'s <a href="https://mastodon.bsd.cafe/tags/helgrind" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>helgrind</span></a> useless for code using <a href="https://mastodon.bsd.cafe/tags/atomic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>atomic</span></a> operations? Example, it complains about this:</p><p>==9505== Possible data race during read of size 4 at 0xADD57F4 by thread #14<br>==9505== Locks held: none<br>==9505== at 0x23D0F1: PSC_ThreadPool_cancel (threadpool.c:761)<br>[....]<br>==9505== This conflicts with a previous write of size 4 by thread #6<br>==9505== Locks held: none<br>==9505== at 0x23CDDE: worker (threadpool.c:373)</p><p>so, here's threadpool.c:761:</p><p> if ((pthrno = atomic_load_explicit(<br> &amp;job-&gt;pthrno, memory_order_consume)) &gt;= 0)</p><p>and here's threadpool.c:373:</p><p> atomic_store_explicit(&amp;currentJob-&gt;pthrno, -1,<br> memory_order_release);</p><p>Ok, I *think* this should be fine? Do I miss something?</p><p>(screenshots for readability ...)</p><p><a href="https://mastodon.bsd.cafe/tags/c" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>c</span></a> <a href="https://mastodon.bsd.cafe/tags/coding" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>coding</span></a> <a href="https://mastodon.bsd.cafe/tags/c11" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>c11</span></a> <a href="https://mastodon.bsd.cafe/tags/atomics" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>atomics</span></a></p>
Felix Palmen :freebsd: :c64:<p>I now experimented with different ideas how to implement the <a href="https://mastodon.bsd.cafe/tags/lockfree" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>lockfree</span></a> <a href="https://mastodon.bsd.cafe/tags/queue" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>queue</span></a> for multiple producers and multiple consumers. Unsurprisingly, some ideas just didn't work. One deadlocked (okaaay ... so it wasn't lockfree) and I eventually gave up trying to understand why.</p><p>The "winner" so far is only "almost lockfree", but at least slightly improves performance. Throughput is the same as with the simple locked variant, but average response times are 10 to 20% quicker (although they deviate stronger for whatever reason). Well, that's committed for now:</p><p><a href="https://github.com/Zirias/poser/commit/4f2f80a8266e4762e04ead2b802e7a7c1b55090b" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/Zirias/poser/commit</span><span class="invisible">/4f2f80a8266e4762e04ead2b802e7a7c1b55090b</span></a></p><p><a href="https://mastodon.bsd.cafe/tags/C11" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>C11</span></a> <a href="https://mastodon.bsd.cafe/tags/atomics" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>atomics</span></a></p>
Felix Palmen :freebsd: :c64:<p>Next <a href="https://mastodon.bsd.cafe/tags/swad" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>swad</span></a> improvement: Make sure to <a href="https://mastodon.bsd.cafe/tags/wipe" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>wipe</span></a> <a href="https://mastodon.bsd.cafe/tags/passwords" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>passwords</span></a> from RAM directly after used. That's more of a <a href="https://mastodon.bsd.cafe/tags/security" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>security</span></a> precaution, because there *should* be no way how an attacker can access a running process' memory, but you never know which bugs surface 🙈.</p><p>Unexpectedly, that posed <a href="https://mastodon.bsd.cafe/tags/portability" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>portability</span></a> issues. <a href="https://mastodon.bsd.cafe/tags/C11" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>C11</span></a> has <a href="https://mastodon.bsd.cafe/tags/memset_s" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>memset_s</span></a> ... a pretty weird function, but suitable for wiping. It's there on <a href="https://mastodon.bsd.cafe/tags/FreeBSD" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>FreeBSD</span></a> and on <a href="https://mastodon.bsd.cafe/tags/OpenBSD" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>OpenBSD</span></a>. Not on <a href="https://mastodon.bsd.cafe/tags/NetBSD" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>NetBSD</span></a> though. But NetBSD offers the much saner <a href="https://mastodon.bsd.cafe/tags/C23" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>C23</span></a> function <a href="https://mastodon.bsd.cafe/tags/memset_explicit" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>memset_explicit</span></a>. Looking at <a href="https://mastodon.bsd.cafe/tags/Linux" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Linux</span></a>, there's neither. But there is the (non-standard!) <a href="https://mastodon.bsd.cafe/tags/explicit_bzero" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>explicit_bzero</span></a> 🤯 .. and with glibc, it requires _DEFAULT_SOURCE to be defined as soon as you compile with a C standard version given to the compiler. This function exists on some other systems as well, but there's confusion whether it should be declared in string.h or strings.h. 🤪 </p><p>Here's the full set of compile-tests I'm now doing, only to find the best way to really erase memory:<br><a href="https://github.com/Zirias/swad/blob/master/src/bin/swad/swad.mk#L6" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/Zirias/swad/blob/ma</span><span class="invisible">ster/src/bin/swad/swad.mk#L6</span></a></p><p>And if none of these functions is found, swad uses the "hacky" way that most likely works as well: Access the normal memset function via a volatile pointer.</p>
Miguel Afonso Caetano<p>"Canadians could enjoy the resliency that comes of having a domestic tech and repair sector, and could count on it through pandemics and Trumpian trade-war.</p><p>All of that and more could be ours, except for the cowardice and greed of Tony Clement and James Moore and the Harper Tories who voted C-11 into law in 2012.</p><p>Everything the "radical extremists" warned them of has come true. It's long past time Canadians tore up anticircumvention law and put the interests of the Canadian public and Canadian tech businesses ahead of the rent-seeking enshittification of American Big Tech.</p><p>Until we do that, we can keep on passing all the repair and interop laws we want, but each one will be hamstrung by Moore and Clement's "felony contempt of business model" law, and the contempt it showed for the Canadian people."</p><p><a href="https://pluralistic.net/2024/11/15/radical-extremists/#sex-pest" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">pluralistic.net/2024/11/15/rad</span><span class="invisible">ical-extremists/#sex-pest</span></a></p><p><a href="https://tldr.nettime.org/tags/Canada" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Canada</span></a> <a href="https://tldr.nettime.org/tags/USA" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>USA</span></a> <a href="https://tldr.nettime.org/tags/RightToRepair" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>RightToRepair</span></a> <a href="https://tldr.nettime.org/tags/Interoperability" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Interoperability</span></a> <a href="https://tldr.nettime.org/tags/C11" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>C11</span></a> <a href="https://tldr.nettime.org/tags/BigTech" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>BigTech</span></a></p>
trendless<p>This is why the marketing/messaging about legislation doesn't matter -- because the lawyers who will be leveraging it dgaf what was said by others, only what it allows them to argue.</p><p>&gt; Our politics is often dominated by debates about deceptive communication, frequently characterized as misinformation or disinformation. For my money, the government’s approach on Bill C-11 provides a paradigm example. Just ask the lawyers at the Ministry of Justice.</p><p>🔗 Government Court Filing on Bill C-11: “The Act Does Allow For the Regulation of User-Uploaded Programs on Social Media Services” <a href="https://www.michaelgeist.ca/2024/06/government-court-filing-on-bill-c-11-the-act-does-allow-for-the-regulation-of-user-uploaded-programs-on-social-media-services/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://www.</span><span class="ellipsis">michaelgeist.ca/2024/06/govern</span><span class="invisible">ment-court-filing-on-bill-c-11-the-act-does-allow-for-the-regulation-of-user-uploaded-programs-on-social-media-services/</span></a></p><p><a href="https://zeroes.ca/tags/BillC11" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>BillC11</span></a> <a href="https://zeroes.ca/tags/C11" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>C11</span></a></p>
Minoru<p>Turns out <a href="https://functional.cafe/tags/Linux" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Linux</span></a> moved from C89 to <a href="https://functional.cafe/tags/C11" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>C11</span></a> a couple years back: <a href="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=50560ce6a0bdab2fc37384c52aa02c7043909d2c" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">git.kernel.org/pub/scm/linux/k</span><span class="invisible">ernel/git/torvalds/linux.git/commit/?id=50560ce6a0bdab2fc37384c52aa02c7043909d2c</span></a> It's quite surprising; I thought they'x upgrade only if GCC dropped support for C89 :D</p><p>(I'm catching up on my Pocket archive, can you tell? BTW I still find <a href="https://functional.cafe/tags/LWN" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>LWN</span></a> the best source of inspiration for good software engineering. Just read some, and you're guaranteed to experience an urge to roll up your sleeves and go hack on something.)</p>

Andrew Coyne very clearly articulates why the Canadian goverment's #C11 #LinkTax and #C18 internet #CanCon bills are actively harmful to Canadians and our access to #journalism and the #internet generally. Certainly we have challenges to face on these issues, but a good start would be not making things worse with misguided and heavy-handed regulations

theglobeandmail.com/opinion/ar

The Globe and Mail · The government dug a deep hole for itself with Bills C-11 and C-18. And it’s only digging deeperBy Andrew Coyne

Watched Aaron Gunn's latest vid "The End of Free Speech in Canada" re Bill #C11, featuring intervus with #Poilievre, Ezra Levant, & #jordanpeterson.

But he expressed his concerns best on a panel at ManningCentre/Canada Strong&Free&Proud bunfest in March when he explained:
"A lot of people get their conservative content from US -Ben Shapiro, Joe Rogan-so they're going to bury all that deep on the algorithm if you're Canadian." #cdnpoli #rightwing
Interesting choice of attire for the promo btw

Continued thread

I also care in all kinds of crazy ways about communications policy. I have an MA in Communication from #Stanford, and I spent 30 years as a working journalist, with the #CBC and #Postmedia among others. As a member the Transportation and Communications committee (aka #TRCM) I work on comms policy of all sorts, including the controversial #C11 #C18 and the issues involving #Meta #Facebook #Google #Alphabet etc. So if you are a comms policy wonk, please let's connect! #introduction #journalism

@Paulatics In #C11, CBC Radio Canada who argued in favour of C-11 have gotten exactly what they asked for. But now, they realize this means reduced YouTube revenues for their own videos posted on YT since YouTube will pass on part of regulatory costs to creators. (there is 45% (YT) 55% (creator) split of ad revenues, and YouTube will split regulatory costs the same).
Same with legacy media whose web sites will now have to contribute and want exemptions.

Here’s a thorough analysis of how we will be forced to pay in every way for dangerous federal legislation #C11 and how incapable the #CRTC is in acting in the interests of Canadians. Make no mistake, this bill has one purpose: enrich the coffers of #Bell and #Rogers
open.substack.com/pub/mgeist/p

Michael GeistReady, Fire, Aim: Eleven Thoughts on the CRTC’s Bill C-11 ConsultationsBy Michael Geist
Continued thread

Stars were bright points instead of comet-like blurs. I was even able to see M13 — the grand globular #starcluster in #Hercules — though between #lightpollution and atmospheric haze, the view was low contrast but filled the field of view; I can hardly wait for better seeing! I tore down for the night happy to have the old C11 performing well and ready for some cosmic exploration. #C11 #collimation #M13 #venus #astronomy