Now

Pet is enjoying summertime real life. Anyway, there's nobody left on the internet to talk with.


Nah, the terminology is awful.

Scope is better but still not correct.

TBD

Also, nullptr should define the same scope.

So,

shmem may point to any area, including thread-local, because in some places an existing pointer is used. So deep copies by default go to the same scope.

Also, this make possible to share values directly across threads.


Pet is revising PetWay memory model.

What humans invented by now:

And their execution model consists of:

Below are pet's ideas to make things lock-free.

All PetWay values should be thread-local. Which means allocators are thread-local. No locking at all. That's simply unnecessary.

For I/O bound stuff that's okay because tasks are thread-local and most apps are single-threaded.

Values can be shared.

Pet added share method to the basic interface. For integral values this method is unnecessary. No matter where values are stored, they can be freely moved around. share method is necessary for types that have allocated data. It allocates new block in a region defined by shmem argument and moves the data there.

Constructors also accept shmem argument (in ctor_arg structure). So values can be created directly in specific regions.

Each region may have its own allocator. Internally, all allocators are the same for now, just using thread and interprocess synchronization primitives for process-local and global shared memory respectively.

Interesting things happen when the data is about to be freed in other thread. As long as each thread has its own allocator, pw_free will figure out that the allocator is wrong and will abort the program.

As long as thread-local allocator is selected when shmem argument is nullptr, there's no way to share values directly with other threads.

Surely, one thread can give another a pointer to read the value, but modification will likely fail.

In PetLang the use of shmem will depend on the scope of variables. This should be transparent but the design is TBD.


Pet skimmed through all those lock-free linked list algorithms. They all look like a poor version of spinlock, no wonder the performance is still nonlinear.

The problem is that a thread cannot tell where other concurrent thread is running. If on the same CPU, then it must give up its quantum. Otherwise, spin around.

But spinning is not a good solution.


Meow! This evening pet has stumbled across an /ir/relevant blog post https://blog.haschek.at/2026/you-should-selfhost-your-mail.html

The relevant part is it's title. The content is rather not really.

Self-hosting email is close to the top of pet's to-do list, right below licking balls. Pet had experience with this in one of its past lives so it has a bit of knowledge.

Email is a technology of dinosaurs and this is the biggest problem. Dinosaurs were chained to castles where one castle used to host only one computer. Luckily, things have changed and now everyone has such a castle in its pocket, with much, much bigger computing power.

But dinosaurs did not change. The world became mobile but as you can't take Chicago out of the girl, you can't take chains out of dinos.

Pet is not chained. Pet's dream is to selfhost email on a couple of mobile devices.

But client-server model sucks, requiring a static IP address. If you move frequently, modifying MX record is a pain. This can be automated, but... There's a bigger problem: dinos still check PTR record.

Even in a relatively recent development, OpenSMTPD, in the mobile era, they implemented PTR check. Pet saw who, pet saw the patch, pet saw delightful comments.

Yuck!

Most mailing lists pet unsuccessfully tried to participate do PTR check. Very strictly.

Even GMail DOES NOT CHECK PTR! At least, it did not circa 2020 But you won't be able to communicate with Gmail users because all your emails will end up in spam folder, even if you correctly setup all those DKIM, SPF, PTR. GMail wants you to use GMail and nothing else.

So. If you want to self-host email and keep it working, you must seriously ask youself: why?

Why pet needs email? Only because old-school sites still exist and they want email to confirm registration. That's all. Yes, that's the only reason. Take away that old crap and pet does not need email at all!

Of course, pet is lying. It does need email, but just for another minor reason. That's why it is planning to run its own email server.

That's another point: the server.

Email servers were developed to serve thousands of users.

But pet is the only user.

You will be the only user.

Who else? Your family members? Your kids? Don't make pet laugh. Kids never trust parents, they will quickly find out you can read their messages and they won't use it. Never.

Nevertheless, running yet another server is cool. As a protocol, email is pretty good and If you make you server less restrictive, without DKIM/SPF/PTR crap, more organisms will be able to communicate with you.

And don't be afraid of spam. Pet published its email addresses but never seen any spam on its new domains. The only huge amount of spam came to one revived domain which means spammers are dinos and other old farts who just keep their Core2Duos still plugged in just because they are nice and warm.

Seriously, only friends know your email. If you want to publish it, publish another one. You own the whole server, at last.

Don't use catch-all address. Just reject crap. And require TLS.

GPT for spam filtering? Yuck! Yuck! Yuck!

Docker image? Yuck! Yuck! Yuck!

Learn! Educate yourself!

And, the most important thing for pets: they do need a VPS, but not for hosting anything on it. Just for static IP. Run everything at home via tunnels. Do not keep certificate keys on VPS. Don't let hosters to sniff your butt as AWS do.

Damn, this needs to go to meows section.

P.S. for the completeness:

https://blog.haschek.at/2023/ssh-based-comment-system.html is a cool idea but that organism missed one point: let real users upload their SSH keys. Filtering by IP sucks in terms of network neutrality.

No wonder pet sees no comments below any of his posts.

P.P.S.

If one sends a message from a selfhosted email server to another selfhosted email server over TLS, do they need email encryption?

Fuck, no! Unless they are morons and keep TLS keys on a VPS.


Pet has stumbled acrross a funny comment https://lobste.rs/s/ax914v/protecting_our_floss_commons_from_llms

Back when compilers were invented, did folks point out that a compiler uses more energy than does an assembler, and an optimising compiler uses even more? Did they complain that using a high-level language enabled a single programmer to produce what used to take a team? Did they complain about a ‘digital divide’ between those who could afford procuring and running high-level languages and those stuck with machine code?

LOL. Each high level language had a spark and they did not breed stupidity.

Besides, what I to expect from those who cannot even write sane crawler in the first place? It looks like they're unable to use their own AI for that.


Watching forums and social networks disappear pet gets more and more convinced that client-server model is the root of all evil. Every human has an incredible computing power in their pocket but they still cannot communicate without a third party.

Coding assistants are slowly melting their poor brains and they won't be able to desing anything better even by 2030. Matrix, Jitsi, and XMPP clients for mobile are best examples.


Pet had to move back to Thunderbird.

ClawsMail is good, but gmail fucked up everything with OAuth.

Fuck gmail.

There's only a few accounts left from past lives and it's time to setup redirects and forget about gmail for good.


Priorities:

Before