veganism.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
Veganism Social is a welcoming space on the internet for vegans to connect and engage with the broader decentralized social media community.

Administered by:

Server stats:

171
active users

#glibc

0 posts0 participants0 posts today

Today, I implemented the #async / #await pattern (as known from #csharp and meanwhile quite some other languages) ...

... in good old #C! 😎

Well, at least sort of.

* It requires some standard library support, namely #POSIX user context switching with #getcontext and friends, which was deprecated in POSIX-1.2008. But it's still available on many systems, including #FreeBSD, #NetBSD, #Linux (with #glibc). It's NOT available e.g. on #OpenBSD, or Linux with some alternative libc.

* I can't do anything about the basic language syntax, so some boilerplate comes with using it.

* It has some overhead (room for extra stacks, even extra syscalls as getcontext unfortunately also always saves/restores the signal mask)

But then ... async/await in C! 🥳

Here are the docs:
zirias.github.io/poser/api/lat

zirias.github.ioposer: PSC_AsyncTask Class Reference

I finally eliminated the need for a dedicated #thread controlling the pam helper #process in #swad. 🥳

The building block that was still missing from #poser was a way to await some async I/O task performed on the main thread from a worker thread. So I added a class to allow exactly that. The naive implementation just signals the main thread to carry out the requested task and then waits on a #semaphore for completion, which of course blocks the worker thread.

Turns out we can actually do better, reaching similar functionality like e.g. #async / #await in C#: Release the worker thread to do other jobs while waiting. The key to this is user context switching support like offered by #POSIX-1.2001 #getcontext and friends. Unfortunately it was deprecated in POSIX-1.2008 without an obvious replacement (the docs basically say "use threads", which doesn't work for my scenario), but still lots of systems provide it, e.g. #FreeBSD, #NetBSD, #Linux (with #glibc) ...

The posercore lib now offers both implementations, prefering to use user context switching if available. It comes at a price: Every thread job now needs its private stack space (I allocated 64kiB there for now), and of course the switching takes some time as well, but that's very likely better than leaving a task idle waiting. And there's a restriction, resuming must still happen on the same thread that called the "await", so if this thread is currently busy, we have to wait a little bit longer. I still think it's a very nice solution. 😎

In any case, the code for the PAM credential checker module looks much cleaner now (the await "magic" happens on line 174):
github.com/Zirias/swad/blob/57

The #Maneage #reproducibility system for scientific research papers that starts from a minimal POSIX-like host OS does not yet build [1] the #GNUCLibrary = #GLibC . We have a draft implementation building glibc *after* #GCC [2]; and an alternative proposal arguing that building glibc *first* and gcc second would be more long-term sustainable [[1] comment18].

Should GLibC be built first? Why (or why not)?

[1] savannah.nongnu.org/task/?1539
[2] gitlab.com/maneage/project-dev

@landley @burnoutqueen Yeah...

#GPLv3 is a desaster as it's 99% ideology and 1% license text and alongside #AGPLv3 completely ignores the reality of how #licensing and #patents and #IP works.

  • Not that I like the status-quo, but we'd rather see businesses steer clear of anything GPLv2+ or GPLv3 or worse.

And on the flipside we basically get "source available" stuff like #SSPL which only serves as a means to commit #AssetDenial and monopolize commercial offerings...

Most people appreciate the fact that Go programs compile statically, as it makes deploying #Go programs a lot easier. Unfortunately, they aren’t always statically compiled.

Using cgo, either in a 3rd party package or in the standard library, usually requires linking to a libc. Both net and os/user are two packages known for using cgo and requiring a libc. On most Linux systems, that leaves us with programs dynamically linking against the glibc. Usually, that’s not a problem in itself, if we deploy our programs to machines that have a glibc of a matching version. If they don’t have a matching #glibc , however, things tend to go south.
honnef.co/articles/statically-

Dominik Honnef's websiteStatically compiled Go programs, always, even with cgo, using musl — Dominik Honnef
Replied in thread

@krishean that's not how #systemd works.

SystemD was created because #SysVinit was shit and noone fixed it or made something better.

#Wayland is the future as #Xorg is being #EoL'd.

  • #Linux as a Kernel works fine, so no reason to replace it.

For the shitty #GlibC we have alternatives like #bionic and espechally #musl!

youtube.com/watch?v=o_AIw9bGogo

The GNU C Library, often referred to as "glibc," is one of the most critical components of the GNU system and Linux operating systems. It provides the fundamental system interface for C programs, offering essential services such as process control, memory allocation, and I/O handling, which enable applications to interact with the underlying operating system.

Read More: machaddr.substack.com/p/the-ev

#GNU#glibc#C
Replied in thread

@hllizi @haskal that's one way to put it, but it completely ignores how to get devs to support an OS:

  • Being able to get some MVP run quickly and dirty to showcase sth.

This (slongside with #GLibC messing up everything with every minor update is the reason why #Linux failed on the #Desktop for so long:

  • Compare that to #Android and #Windows where one can write a simple game or app and it'll likely still run as it did 10 years ago...
Replied in thread

@enigmatico @privateger there's a reason I work on @OS1337 and why it's intended to be a #GNU-free #toybox+#musl / #linux distro:

  • #GLibC is a shitshow maintained by nonchalant assholes that constantly brick systems with minor updates whilst denying the right to exist to #CCSS and who think "recompile it yourself" is an acceptable answer even outside of #FLOSS projects.

The only #GNUtils part that neither @landley nor I were able to replace is the #GCC because AFAIK Linux just won't compile under #Clang / #LLVM...

  • The moment that isn't the case anymore I')( happily ditch tht too, cuz GNU / #FSF are just bad and the only recourse I have aggainst them is to #boycott them into irrelevancy...

Shall all those people at the FSF complain at #RMS for alienating people and harming FLOSS in general or as @ncommander once said:
' […] #OpenSource thrives not hecause but in spite of #Stallman […]' cuz being a visionary predicting #Enshittification like #DRM doesn't make him a less unlikeable character to be polite...

Continued thread

@gnomelibre , @fnurkla , thanks for the info. It reminded me that the source of locale data is glibc, and just found out that glibc's locale data for my locale, es_CO, doesn't specify first_weekday for the LC_TIME category, so it seems that's why GNOME calendars default to Sunday.

Maybe the thing to do is send glibc a patch to set es_CO's first_weekday and first_workday to 2 (Monday).

🩹