mastodontech.de ist einer von vielen unabhängigen Mastodon-Servern, mit dem du dich im Fediverse beteiligen kannst.
Offen für alle (über 16) und bereitgestellt von Markus'Blog

Serverstatistik:

1,4 Tsd.
aktive Profile

#C11

0 Beiträge0 Beteiligte0 Beiträge heute
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>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>
Tyler Smith<p>Andrew Coyne very clearly articulates why the Canadian goverment's <a href="https://ottawa.place/tags/C11" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>C11</span></a> <a href="https://ottawa.place/tags/LinkTax" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>LinkTax</span></a> and <a href="https://ottawa.place/tags/C18" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>C18</span></a> internet <a href="https://ottawa.place/tags/CanCon" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CanCon</span></a> bills are actively harmful to Canadians and our access to <a href="https://ottawa.place/tags/journalism" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>journalism</span></a> and the <a href="https://ottawa.place/tags/internet" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>internet</span></a> 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 </p><p><a href="https://www.theglobeandmail.com/opinion/article-the-government-dug-a-deep-hole-for-itself-with-bills-c-11-and-c-18-and/" rel="nofollow noopener" target="_blank"><span class="invisible">https://www.</span><span class="ellipsis">theglobeandmail.com/opinion/ar</span><span class="invisible">ticle-the-government-dug-a-deep-hole-for-itself-with-bills-c-11-and-c-18-and/</span></a></p><p><a href="https://ottawa.place/tags/paywall" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>paywall</span></a></p>
Michael Geist<p>CRTC establishes new registration requirements arising from Bill C-11 for streaming services worldwide, including video and podcasters. Any service - alone or as a group - generating $10M+ in broadcast revenues in Canada must register by November 29, 2023.<br><a href="https://twitter.com/CRTCeng/status/1707818973880823935" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">twitter.com/CRTCeng/status/170</span><span class="invisible">7818973880823935</span></a></p><p><a href="https://mas.to/tags/C11" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>C11</span></a></p>
Senator Paula Simons🇨🇦<p>I also care in all kinds of crazy ways about communications policy. I have an MA in Communication from <a href="https://mstdn.ca/tags/Stanford" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Stanford</span></a>, and I spent 30 years as a working journalist, with the <a href="https://mstdn.ca/tags/CBC" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CBC</span></a> and <a href="https://mstdn.ca/tags/Postmedia" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Postmedia</span></a> among others. As a member the Transportation and Communications committee (aka <a href="https://mstdn.ca/tags/TRCM" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>TRCM</span></a>) I work on comms policy of all sorts, including the controversial <a href="https://mstdn.ca/tags/C11" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>C11</span></a> <a href="https://mstdn.ca/tags/C18" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>C18</span></a> and the issues involving <a href="https://mstdn.ca/tags/Meta" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Meta</span></a> <a href="https://mstdn.ca/tags/Facebook" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Facebook</span></a> <a href="https://mstdn.ca/tags/Google" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Google</span></a> <a href="https://mstdn.ca/tags/Alphabet" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Alphabet</span></a> etc. So if you are a comms policy wonk, please let's connect! <a href="https://mstdn.ca/tags/introduction" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>introduction</span></a> <a href="https://mstdn.ca/tags/journalism" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>journalism</span></a></p>
Brandon<p>Looking forward to only being able to get news only from authorized Canadian news sources, because Canadian news outlets are so trustworthy. So good for democracy and freedom of information! <a href="https://appdot.net/tags/cdnpoli" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>cdnpoli</span></a> <a href="https://appdot.net/tags/c11" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>c11</span></a> <a href="https://appdot.net/tags/billc11" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>billc11</span></a> <a href="https://appdot.net/tags/Canada" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Canada</span></a></p>
Michael Geist<p>This post is supportive of Bill C-11 but the examples demonstrate the problems. Do we really want the CRTC parsing through user content feeds to decide the kind of content people get: a bit more French music, hands off home renovation videos, etc? </p><p>---<br>RT @howardalaw<br>The never ending ambiguity of the Online Streaming Act <a href="https://mas.to/tags/C11" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>C11</span></a>. What the <a href="https://mas.to/tags/CRTC" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CRTC</span></a> might do about discoverability.</p><p><a href="https://mediapolicy.ca/2023/04/28/the-never-ending-ambiguity-of…" rel="nofollow noopener" target="_blank"><span class="invisible">https://</span><span class="ellipsis">mediapolicy.ca/2023/04/28/the-</span><span class="invisible">never-ending-ambiguity-of…</span></a><br><a href="https://twitter.com/howardalaw/status/1651940097015554056" rel="nofollow noopener" target="_blank"><span class="invisible">https://</span><span class="ellipsis">twitter.com/howardalaw/status/</span><span class="invisible">1651940097015554056</span></a></p>