Conversation
Notices
-
this ad CAN be blocked, bitch (kirby@lab.nyanide.com)'s status on Monday, 30-Oct-2023 14:29:19 JST this ad CAN be blocked, bitch Fucking race conditions.
How does flock work and help in preventing race conditions?-
Machismo (zerglingman@freespeechextremist.com)'s status on Monday, 30-Oct-2023 14:29:34 JST Machismo @kirby Well first you have to remove the niggers... -
anonymous (anonymous@freespeechextremist.com)'s status on Monday, 30-Oct-2023 14:31:39 JST anonymous @Zerglingman @kirby You also have to remove the mexicans too, they aren’t very good at races what with taking breaks all the time.
Machismo repeated this. -
this ad CAN be blocked, bitch (kirby@lab.nyanide.com)'s status on Monday, 30-Oct-2023 14:31:47 JST this ad CAN be blocked, bitch @anonymous @Zerglingman PLEASE don't devolve actually looking for an answer to this one... it's a programming question if it wasn't clear Machismo repeated this. -
Machismo (zerglingman@freespeechextremist.com)'s status on Monday, 30-Oct-2023 14:32:15 JST Machismo @kirby @anonymous Are you talking about flock(1) or a C function by the same name? -
anonymous (anonymous@freespeechextremist.com)'s status on Monday, 30-Oct-2023 14:32:55 JST anonymous @kirby @Zerglingman Yeah guys! God he just needs to make sure the Kenyans get into the race stop being childish. :housemad:
Machismo repeated this. -
this ad CAN be blocked, bitch (kirby@lab.nyanide.com)'s status on Monday, 30-Oct-2023 14:33:02 JST this ad CAN be blocked, bitch @Zerglingman @anonymous the c function. Machismo likes this. -
this ad CAN be blocked, bitch (kirby@lab.nyanide.com)'s status on Monday, 30-Oct-2023 14:33:53 JST this ad CAN be blocked, bitch @anonymous @Zerglingman did not know fse has the house emojis
Thankfully I have all of the fse emojis :) -
tsoifan1997 (sysrq@lab.nyanide.com)'s status on Monday, 30-Oct-2023 14:34:42 JST tsoifan1997 @kirby @anonymous @Zerglingman
:housewant:Machismo likes this. -
anonymous (anonymous@freespeechextremist.com)'s status on Monday, 30-Oct-2023 14:34:47 JST anonymous @kirby @Zerglingman :houseno:
Machismo likes this. -
this ad CAN be blocked, bitch (kirby@lab.nyanide.com)'s status on Monday, 30-Oct-2023 14:34:50 JST this ad CAN be blocked, bitch @sysrq @Zerglingman @anonymous this and :3kliks_gaming: will take over the world. Machismo likes this. -
anonymous (anonymous@freespeechextremist.com)'s status on Monday, 30-Oct-2023 14:35:00 JST anonymous @sysrq @kirby @Zerglingman :housesmug:
Machismo likes this. -
this ad CAN be blocked, bitch (kirby@lab.nyanide.com)'s status on Monday, 30-Oct-2023 14:35:32 JST this ad CAN be blocked, bitch @Zerglingman @anonymous anyways plz Machismo likes this. -
Machismo (zerglingman@freespeechextremist.com)'s status on Monday, 30-Oct-2023 14:37:58 JST Machismo @kirby @anonymous What can it lock? Does it have its own registers, or does it just work on vars?
In any case, it would be something like... When you write to the shared location, you first check if the lock is set, if not, set it then write. Presumably the lock function takes care of race conditions internally, maybe it does the checking and the setting in one move to ensure it.
Then when you read from it you unset the lock.
Though, first: why are two threads trying to write to the same location? -
anonymous (anonymous@freespeechextremist.com)'s status on Monday, 30-Oct-2023 14:38:04 JST anonymous @kirby @Zerglingman :housesmug3:
Machismo likes this. -
tsoifan1997 (sysrq@lab.nyanide.com)'s status on Monday, 30-Oct-2023 14:38:19 JST tsoifan1997 @kirby @Zerglingman @anonymous
I'm reading the man page right now.Machismo likes this. -
this ad CAN be blocked, bitch (kirby@lab.nyanide.com)'s status on Monday, 30-Oct-2023 14:39:55 JST this ad CAN be blocked, bitch @Zerglingman @anonymous files
We're making a "database" [using that loosely]Machismo likes this. -
Machismo (zerglingman@freespeechextremist.com)'s status on Monday, 30-Oct-2023 14:42:19 JST Machismo @kirby @anonymous Oh so it's basically the same as flock(1).
In any case, not that different? If you can't flock, sleep until you can, then write? -
tsoifan1997 (sysrq@lab.nyanide.com)'s status on Monday, 30-Oct-2023 14:42:54 JST tsoifan1997 @kirby @Zerglingman @anonymous
Check IRC.Machismo likes this. -
anonymous (anonymous@freespeechextremist.com)'s status on Monday, 30-Oct-2023 14:43:12 JST anonymous @kirby @Zerglingman What exactly are you doing with the database that you need to write with two separate threads? I make my own DBs all the time and always only use one thread.
Machismo likes this. -
this ad CAN be blocked, bitch (kirby@lab.nyanide.com)'s status on Monday, 30-Oct-2023 14:43:13 JST this ad CAN be blocked, bitch @sysrq @Zerglingman @anonymous okay let me turn on my compute. Machismo likes this. -
this ad CAN be blocked, bitch (kirby@lab.nyanide.com)'s status on Monday, 30-Oct-2023 14:43:16 JST this ad CAN be blocked, bitch @anonymous @Zerglingman discord bot.
My library likes asynchronous functions.Machismo likes this. -
this ad CAN be blocked, bitch (kirby@lab.nyanide.com)'s status on Monday, 30-Oct-2023 14:43:25 JST this ad CAN be blocked, bitch @Zerglingman @anonymous so it's not just blocking until the lock is released? Machismo likes this. -
tsoifan1997 (sysrq@lab.nyanide.com)'s status on Monday, 30-Oct-2023 14:43:30 JST tsoifan1997 @kirby @Zerglingman @anonymous
Basically.Machismo likes this. -
Machismo (zerglingman@freespeechextremist.com)'s status on Monday, 30-Oct-2023 14:44:00 JST Machismo @kirby @anonymous asyncio sleep? :D -
this ad CAN be blocked, bitch (kirby@lab.nyanide.com)'s status on Monday, 30-Oct-2023 14:44:22 JST this ad CAN be blocked, bitch @Zerglingman @anonymous fuck Machismo likes this. -
anonymous (anonymous@freespeechextremist.com)'s status on Monday, 30-Oct-2023 14:46:32 JST anonymous @kirby @Zerglingman One thing you could try is loading the DB into memory and then using internal threads to manage it, then write on exit. I used this trick on a project with a particularly complex DB once. It does depend on the size of the DB though.
Machismo likes this. -
this ad CAN be blocked, bitch (kirby@lab.nyanide.com)'s status on Monday, 30-Oct-2023 14:47:35 JST this ad CAN be blocked, bitch @anonymous @Zerglingman but this application is going to be a daemon Machismo likes this. -
Machismo (zerglingman@freespeechextremist.com)'s status on Monday, 30-Oct-2023 14:47:51 JST Machismo @kirby @anonymous >discord
>daemon
checks out -
anonymous (anonymous@freespeechextremist.com)'s status on Monday, 30-Oct-2023 14:49:17 JST anonymous @Zerglingman @kirby I’ve never made a daemon please explain like i am a retard because i am
Machismo likes this. -
Machismo (zerglingman@freespeechextremist.com)'s status on Monday, 30-Oct-2023 14:49:51 JST Machismo @anonymous @kirby In computing terms, a daemon is just a program that runs in the background.
It is a joke about discord being evil. -
this ad CAN be blocked, bitch (kirby@lab.nyanide.com)'s status on Monday, 30-Oct-2023 14:49:56 JST this ad CAN be blocked, bitch @anonymous @Zerglingman while (1) {
// run forever! nohup so it doesnt get killed
}Machismo likes this. -
Machismo (zerglingman@freespeechextremist.com)'s status on Monday, 30-Oct-2023 14:51:04 JST Machismo @kirby @anonymous (*Actually I think a daemon originally referred to programs that manage other background programs. Not certain of that.) -
anonymous (anonymous@freespeechextremist.com)'s status on Monday, 30-Oct-2023 14:51:08 JST anonymous @kirby @Zerglingman Bro you can still manage a DB in a loop tho.
Machismo likes this. -
this ad CAN be blocked, bitch (kirby@lab.nyanide.com)'s status on Monday, 30-Oct-2023 14:51:12 JST this ad CAN be blocked, bitch @anonymous @Zerglingman async functions don't help my scenerio AT ALL Machismo likes this. -
anonymous (anonymous@freespeechextremist.com)'s status on Monday, 30-Oct-2023 14:53:29 JST anonymous @kirby @Zerglingman Syncronize it then nigger.
Machismo likes this.Machismo repeated this. -
Machismo (zerglingman@freespeechextremist.com)'s status on Monday, 30-Oct-2023 14:54:27 JST Machismo @kirby @anonymous He has a point about internal management, actually. Each thread can have its own space to dump DB writes to, and then a single DB worker thread can read from those and write to file.
Hmm but I guess it is not easy to make reads stay in step there. The DB thread could check the queue for relevant pending changes before answering read requests? -
this ad CAN be blocked, bitch (kirby@lab.nyanide.com)'s status on Monday, 30-Oct-2023 14:55:00 JST this ad CAN be blocked, bitch @anonymous @Zerglingman bruh
how much experience do u have with programming? [not trying to be mean, a lot of the basic terms you dont seem to know tho]Machismo likes this. -
tsoifan1997 (sysrq@lab.nyanide.com)'s status on Monday, 30-Oct-2023 14:55:55 JST tsoifan1997 @anonymous @Zerglingman @kirby
IN THIS HOUSE WE USE BLOCKING, SYNCHRONOUS I/O. -
Machismo (zerglingman@freespeechextremist.com)'s status on Monday, 30-Oct-2023 14:56:21 JST Machismo @sysrq @kirby @anonymous LIKE SAINT TERRY INTENDED
(I do not think he intended that.) -
anonymous (anonymous@freespeechextremist.com)'s status on Monday, 30-Oct-2023 14:56:47 JST anonymous @Zerglingman @kirby I was thinking something more along the lines of internally managing the DB and then on application close writing all changes to the DB, to be read on startup. But I’m a fairly new programmer, and also fairly retarded, so maybe this is a bad way to do it.
Machismo likes this. -
Machismo (zerglingman@freespeechextremist.com)'s status on Monday, 30-Oct-2023 14:57:06 JST Machismo @anonymous @kirby I do think it is a bad way to do it, given that DBs frequently bloat out very quickly. -
this ad CAN be blocked, bitch (kirby@lab.nyanide.com)'s status on Monday, 30-Oct-2023 14:57:13 JST this ad CAN be blocked, bitch @Zerglingman @anonymous oh i thought of this theoretical the other day, i'm not sure how information would be sent around the program though. maybe unix sockets? not too experienced with sockets yet tho Machismo likes this. -
anonymous (anonymous@freespeechextremist.com)'s status on Monday, 30-Oct-2023 14:57:17 JST anonymous @kirby @Zerglingman I knew the difference between asyncronous and syncronous tho
Machismo likes this. -
tsoifan1997 (sysrq@lab.nyanide.com)'s status on Monday, 30-Oct-2023 14:57:24 JST tsoifan1997 @Zerglingman @anonymous @kirby
AND CSP STYLE CONCURRENCY. -
tsoifan1997 (sysrq@lab.nyanide.com)'s status on Monday, 30-Oct-2023 14:58:20 JST tsoifan1997 @kirby @Zerglingman @anonymous
If you need to send information around threads with messages, you may as well use Go (because that's CSP).Machismo likes this. -
Machismo (zerglingman@freespeechextremist.com)'s status on Monday, 30-Oct-2023 14:59:14 JST Machismo @kirby @anonymous For reading? Hmm... -
anonymous (anonymous@freespeechextremist.com)'s status on Monday, 30-Oct-2023 14:59:18 JST anonymous @Zerglingman @kirby I suppose it depends on the use case. I made a text DB and did this, and the text DB is like 5 or 6 MB I think, but that wasn’t a huge factor. Again, though, still retarded.
Machismo likes this. -
this ad CAN be blocked, bitch (kirby@lab.nyanide.com)'s status on Monday, 30-Oct-2023 15:01:54 JST this ad CAN be blocked, bitch @anonymous @Zerglingman nevermind am dumb i just saw the wikipedia article for it Machismo likes this. -
this ad CAN be blocked, bitch (kirby@lab.nyanide.com)'s status on Monday, 30-Oct-2023 15:01:55 JST this ad CAN be blocked, bitch @anonymous @Zerglingman in the general context of threads? cause it's kind of different in some other places, where you can just place a function down and it'll do some stupid magic Machismo likes this. -
anonymous (anonymous@freespeechextremist.com)'s status on Monday, 30-Oct-2023 15:02:02 JST anonymous @Zerglingman @kirby Oh I also hate working asyncronously. That was also a motivating factor.
Machismo likes this. -
Machismo (zerglingman@freespeechextremist.com)'s status on Monday, 30-Oct-2023 15:07:13 JST Machismo @anonymous @kirby
postgres=# select pg_size_pretty(pg_database_size('pleroma'));
pg_size_pretty
----------------
4870 MB
(1 row)
postgres=# select pg_size_pretty(pg_database_size('lemmy'));
pg_size_pretty
----------------
16 MB
(1 row)
I don't use my lemmy instance, at all. As in it has maybe 2 accounts, 1 community, maybe 1 post? Actually maybe it has managed to federate in a few posts.
Most of that is structure, I think. -
Machismo (zerglingman@freespeechextremist.com)'s status on Monday, 30-Oct-2023 15:10:48 JST Machismo @kirby @anonymous (My pleroma instance also has only a handful of accounts, only 2 active currently and one of them's a bot, but I follow this account from there, so it has some 24 hours'-worth of "rent free" in it now, among other things.) -
anonymous (anonymous@freespeechextremist.com)'s status on Monday, 30-Oct-2023 15:11:29 JST anonymous @Zerglingman @kirby Damn almost 5 GB? Damn.
I like the flexability of self-made DB structures. Of course, especially for publicly facing projects, there is a solid case to be made for esablished DBs.
-
Machismo (zerglingman@freespeechextremist.com)'s status on Monday, 30-Oct-2023 15:11:49 JST Machismo @anonymous @kirby Fediverse and its consequences, man. -
anonymous (anonymous@freespeechextremist.com)'s status on Monday, 30-Oct-2023 15:12:44 JST anonymous @Zerglingman @kirby That and I avoid webdev like the plague so I don’t often have to face this problem. :ablobcool:
-
Machismo (zerglingman@freespeechextremist.com)'s status on Monday, 30-Oct-2023 15:12:48 JST Machismo @anonymous @kirby Extremely based. -
anonymous (anonymous@freespeechextremist.com)'s status on Monday, 30-Oct-2023 15:13:57 JST anonymous @Zerglingman @kirby Is it blueballspilled?
Machismo likes this. -
Machismo (zerglingman@freespeechextremist.com)'s status on Monday, 30-Oct-2023 15:14:15 JST Machismo @anonymous @kirby chillidogpilled -
anonymous (anonymous@freespeechextremist.com)'s status on Monday, 30-Oct-2023 15:15:21 JST anonymous @Zerglingman @kirby Also all of my projects are small and clunky. I’ve been looking for a good starter project to get my feet wet in the wider programming world but it’s difficult. It’s either large and complex, or small and uninteresting.
Machismo likes this. -
Machismo (zerglingman@freespeechextremist.com)'s status on Monday, 30-Oct-2023 15:18:00 JST Machismo @anonymous @kirby I wrote my own credentials-manager tool because I was sick of copying and pasting my tokens into vars all the time. Just find something that annoys you and set about fixing it ツ
http://precious.harpy.faith/Zergling_man/tinyscripts/
Oh actually, you could write backends for http://precious.harpy.faith/Zergling_man/lyrics-fetcher/ ツ
... but that's mostly webdev, of sorts.
Actually it can't correctly handle multiple backends yet, I need to fix that. -
Machismo (zerglingman@freespeechextremist.com)'s status on Monday, 30-Oct-2023 15:18:33 JST Machismo @kirby @anonymous Also I really need to learn how to do dll/so stuff, so I can have it handle backends in any language. In conversation permalink -
anonymous (anonymous@freespeechextremist.com)'s status on Monday, 30-Oct-2023 15:21:34 JST anonymous @Zerglingman @kirby My main issue is everything that bugs me is in large projects. The Linux kernel for example is something I’ve had a bone to pick with for the longest time but, well, the line count speaks for itself.
Honestly I just need to pick a lane and stick with it.
In conversation permalink -
anonymous (anonymous@freespeechextremist.com)'s status on Monday, 30-Oct-2023 15:21:34 JST anonymous @Zerglingman @kirby I’ll take a look at your projects. Let you know if anything catches my fancy.
In conversation permalink Machismo likes this. -
Machismo (zerglingman@freespeechextremist.com)'s status on Monday, 30-Oct-2023 15:23:59 JST Machismo @anonymous @kirby Yeah that's reasonable. If you can narrow down to one specific thing you're looking to fix, and then just aim to understand just enough to do that one thing, I think it's a more achieveable problem.
I have fixed several bugs in moment that have improved its usability quite a bit, but I know shit all about qml still ツ
And I think for one bug, I'm going to need to figure it out. But that can come later. Piece by piece, I will understand this thing.In conversation permalink -
anonymous (anonymous@freespeechextremist.com)'s status on Monday, 30-Oct-2023 15:27:27 JST anonymous @Zerglingman @kirby Indeed. Great advice.
Another one of my big problems is it takes me a while to understand even simple code written by someone else. I don’t know if it’s the same for everyone. So that’s also a bit of a roadblock. Even looking at your small scripts is making my eyes swim a little (tho your commenting is basically non existent reeeee).
In conversation permalink Machismo likes this. -
Machismo (zerglingman@freespeechextremist.com)'s status on Monday, 30-Oct-2023 15:28:51 JST Machismo @anonymous @kirby I don't see the point in writing comments that explain what the code does. Anyone can figure out what a bit of code does by reading it, especially if there are sensible names (lol, lmao).
I write comments that explain WHY code does what it does. Generally I try to solve it the most obvious way, and if that fails, I put a comment, often with some stack overflow link, so that anyone who reads it later - mainly me - doesn't have to wonder why it isn't doing it the most obvious way.In conversation permalink
-