Felix Palmen :freebsd: :c64:

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

#C #coding

swad/src/bin/swad/cred/pamchecker.c at 57eefe93cdad0df55ebede4bd877d22e7be1a7f8 · Zirias/swad

Simple Web Authentication Daemon. Contribute to Zirias/swad…

GitHub
Apr 17, 2025, 14:34 · · · 1 · 0
Mark Stosberg

When you have redundant web services with background scheduled tasks, how do you make sure the scheduled tasks only run on one host?

We have the hosts coordinate via a database with frequent check-ins, where one host will promoted to the "main" host to to the jobs if there is not currently or the main host is dead.

#typescript #nodejs #programming #coding #webdev

DrunkenTortoise

Can someone explain the third line
I have reassigned character to “World”
Why does Hello show in console, thanks

#coding #javascript #freecodecamp

Leonardo Ferreira Fontenelle

This thing where you need a computer program to create a new computer program, it's a Ponzi scheme, isn't it?

#programming #coding

useR! 2025 Conference

🌍✈️ Reminder for international travellers who are planning a trip to useR! next August.

1️⃣ Apply for ESTA if traveling under the Visa Waiver Program.

2️⃣ Ensure your passport is valid for 6+ months beyond your stay in the US.

🗽🇺🇸 Prepare ahead to avoid stress & enjoy safe travels this August! 🚀

#rstats #coding

Daniel

Demoscene: Compression optimization

Alexander Grupe describes on his website, how he saves a few bytes in the boot block in order to have more space for demoscene productions.

amiga-news.de/en/news/AN-2025-

#Amiga #demoscene #coding

amiga-news.de - Demoscene: Compression optimization

www.amiga-news.de
PrivacySafe

As we get our products out the door at privacysafe.app we're seeing our press push pick up thanks to @profdiggity 🤓 We're mentioned in #CSO online this month where he drives the point home about vibe #coding :

psafe.ly/2UFs8M

Kianoosh Shakeri

An awful side effect of being a game developer 🤓.
You're excited to play what you've made in the early-to-mid stages of development, but by the time the game is ready, you hate even seeing the main character on the screen because that thing's code alone has traumatized you almost as much as your school bully did 😀
#gamedev #gamedesign #coding

Felix Palmen :freebsd: :c64:

On a #coding mission to improve my #poser lib 😎.

In the current implementation of #swad, I don't really like that I need an extra thread, just to control a child #process. A first piece to add to poser is generic "child process support", which I'm testing right now. I realized I could reuse my #Connection class, which was built for #sockets, but works just as well with #pipes 🙃

TODO now is mostly testing. See screenshots for some mimimal testing code and its output ... would you like this kind of interface? 🤔

#C #programming

Jake in the desert

As 'AI' coding 'assistants' invent nonexistent software libraries to download and use, enterprising attackers create and upload libraries with those names—laced with malware theregister.com/2025/04/12/ai_

#coding #AI #AIBullshit #malware

Ana Tudor 🐯

A fun little scroll-driven thing I made. The text is white over the image, but the image isn't static, it rotates on scroll. 😼

Here's a detailed explanation of the how behind reddit.com/r/css/comments/1jyu

Live on @codepen codepen.io/thebabydino/pen/dPP

Also uses container queries, CSS trigonometric functions.

#CSS #scroll #cssAnimation #code #web #scrollAnimation #frontend #coding #dev #cssVariables #cssTransform #webDev #webDevelopment #cssMaths #trigonometry

Apr 15, 2025, 09:28 · · · 0 · 0