|
hobbesmaster posted:isn’t this what ldxr/stxr are for on ARM? kinda, i was more referring to things like memory ordering https://gcc.gnu.org/wiki/Atomic/GCCMM/AtomicSync like SeqCst (every load or store happens in order and atomically, globally) vs stuff like Release/Acquire (loads and stores can be subtly reordered in some cases, and the synchronization is less heavyweight) and memory fences, too
|
# ? Mar 30, 2023 15:19 |
|
|
# ? May 22, 2024 19:30 |
|
god i hope i never have to do this for real
|
# ? Mar 30, 2023 15:26 |
|
it’s more I thought armv8 was equivalent to x86 on all that because of the explicit, formal memory model and introduction of instructions for barriers, fences and acquire/release?
|
# ? Mar 30, 2023 15:26 |
|
hbag posted:god i hope i never have to do this for real depends on what you want to do
|
# ? Mar 30, 2023 15:29 |
|
tef posted:honestly? not as much as you'd hope. the problem with concurrency lessons is that they teach it in terms of the solutions "here's a mutex, here's a semaphore" and then go "now draw the loving owl". i mean, this all depends on hbags school, our programs here are pretty good on this stuff. best to listen at any rate, because if it's a good treatment it is the kind of stuff that is hard to pick up naturally.
|
# ? Mar 30, 2023 15:44 |
|
hbag posted:god i hope i never have to do this for real Being able to do the horrid boring poo poo is a great way to get your foot in the door for the cushy jobs. They're not likely to come up often even then, but they might be necessary.
|
# ? Mar 30, 2023 15:44 |
|
hbag posted:god i hope i never have to do this for real naaaah, these are the fun bits when you get into it
|
# ? Mar 30, 2023 15:44 |
|
ime there are plenty of jobs where you will never or almost never have to deal with concurrency, but basically no jobs where you won't have to deal with race conditions. it's good to learn about this stuff because identifying and troubleshooting them can be really hard
|
# ? Mar 30, 2023 15:47 |
|
cjs: somehow got the funding to hire my favorite student to do a phd, hype as hell, they are way better than me at the thing i want to do
|
# ? Mar 30, 2023 15:51 |
|
tef posted:they're all hard, they all suck yospos bicth
|
# ? Mar 30, 2023 15:54 |
|
cjs: i think im just gonna gently caress around today since i'm blocked by apple, who seems to take a week to do anything
|
# ? Mar 30, 2023 15:54 |
|
Asleep Style posted:ime there are plenty of jobs where you will never or almost never have to deal with concurrency, but basically no jobs where you won't have to deal with race conditions. it's good to learn about this stuff because identifying and troubleshooting them can be really hard if you're feeling fancy, you can learn about rw-conflicts and ww-conflicts but yeah, after a while you realise that, well, you're just learning about garbage collection. not just the termination detection bits (did all my workers finish), but the bit where deadlocks detection means cycle collection
|
# ? Mar 30, 2023 16:16 |
|
hobbesmaster posted:it’s more I thought armv8 was equivalent to x86 on all that because of the explicit, formal memory model and introduction of instructions for barriers, fences and acquire/release? iirc, x86 really only does SeqCst, and it's arm where the weak barrier whacky town frolics happen
|
# ? Mar 30, 2023 16:16 |
|
Asleep Style posted:ime there are plenty of jobs where you will never or almost never have to deal with concurrency, but basically no jobs where you won't have to deal with race conditions. it's good to learn about this stuff because identifying and troubleshooting them can be really hard come to embedded land, we have such sights to show you
|
# ? Mar 30, 2023 16:17 |
|
Asleep Style posted:ime there are plenty of jobs where you will never or almost never have to deal with concurrency, but basically no jobs where you won't have to deal with race conditions. it's good to learn about this stuff because identifying and troubleshooting them can be really hard fixing them is harder, because no-one will believe you that it works. devs end up being real superstitious about it. i recall having to wait until one boss went on holiday to sneak in a mutex, and suddenly a whole class of errors just vanished. devs also do things like "put unbounded while loops in critical sections", so even if you do get it right, it's an uphill challenge to keep it that way that, and, well, you don't really troubleshoot race conditions, that just ends up in a game of whack a mole. you gotta just write something that enforces determinism from the outset
|
# ? Mar 30, 2023 16:24 |
|
like, a fun concurrency algorithm is keirs multiple compare and swap. for when you have an array of pointers to items in the heap, and want to cas multiple entries atomically. it's kinda ridiculously simple, especially if you use pointer tagging. 1. create a descriptor table in memory, which lists all the old and new values for each pointer 2. for each entry, swap in a pointer to the descriptor table in ascending order of address 3. once complete, swap in the new pointers, in descending order with a reader, if you see a descriptor table, you race the other threads to complete the algorithm, and continue on your way. the only real problem with this algorithm comes down to "do you care if your reads are synchronized" and "do you want a consistent snapshot to work from" if you want to do that, well, you end up having to have some global write epoch, incremented each time a write happens. when you start a read, you store the epoch, when you end it, you check it hasn't changed, and then you know no fuckery has occurred. if it has changed, you give up and try again. which, well, introduces a new problem: reads can be aborted/restarted constantly, and it's possible to lock up any progress if one writer is misbehaving. so you change your writer epoch protocol: increment before you swap in the table, increment afterwards. now writes happen exclusively, and if a reader wants to stop activity, it can just use the epoch as a global lock over the table to halt writes. which almost but not quite solves the problem: a reader that locks can stall other readers. so maybe you end up storing the descriptor table in a ring buffer, indexed by the write epoch used. that way, when a read aborts, you can check to see if any of the values you looked at changed, and either pick the new or the old values to continue on with your work. concurrency!
|
# ? Mar 30, 2023 16:33 |
|
hobbesmaster posted:come to embedded land, we have such sights to show you
|
# ? Mar 30, 2023 16:43 |
|
cjs: love to go into a meeting with product and be told the estimate they came up with for my work and all the people they've told it to before me
|
# ? Mar 30, 2023 16:45 |
|
i've been playing race condition whack-a-mole on this 20 year old codebase for over three years. i wish i had the time - and skill - to do otherwise (this is the same codebase where clock_nanosleep() would outright ignore the absolute-sleep-time flag some 1/100k calls and break everything so it's kinda fundamentally accursed imo) Ciaphas fucked around with this message at 17:03 on Mar 30, 2023 |
# ? Mar 30, 2023 17:00 |
|
born to race pthread is a gently caress lock em all 1989 i am sad dev man 410,757,864,530 Ciaphas fucked around with this message at 17:14 on Mar 30, 2023 |
# ? Mar 30, 2023 17:07 |
|
I do a lot of concurrency in mobile development, which apparently isn’t common outside of mobile gaming it’s fun as hell except when poo poo breaks and then it’s the worst thing in the world
|
# ? Mar 30, 2023 17:09 |
|
kind of want "410,757,864,530 threads busywaiting" for realism
|
# ? Mar 30, 2023 17:09 |
|
Cybernetic Vermin posted:kind of want "410,757,864,530 threads busywaiting" for realism
|
# ? Mar 30, 2023 17:12 |
|
Truman Peyote posted:cjs: love to go into a meeting with product and be told the estimate they came up with for my work and all the people they've told it to before me points aren't real and can mean whatever you want!
|
# ? Mar 30, 2023 17:20 |
|
tef posted:fixing them is harder, because no-one will believe you that it works. devs end up being real superstitious about it. i recall having to wait until one boss went on holiday to sneak in a mutex, and suddenly a whole class of errors just vanished. devs also do things like "put unbounded while loops in critical sections", so even if you do get it right, it's an uphill challenge to keep it that way I would love to work somewhere with devs skilled enough to manage that last part the first race condition I ever dealt with was in an integration test suite that took 12 hours to run. we would write the results of a 15 minute calculation to a file, then immediately try to open the file and compare it to a known good result. some tests started failing intermittently one day. it turns out that whatever C# writefile method we were using didn't wait til the file was completely written before returning, so we were comparing incomplete output data. iirc we fixed it by adding a step that check that the output file size hadn't changed within a certain interval before trying to read it unless you were really familiar with that writefile method ahead of time, this was code that looked like it was completely synchronous. I've run into similar things at every job since, where someone didn't realize that something that appeared synchronous was actually not thanks for the interesting concurrency posts, this is very much outside my wheelhouse
|
# ? Mar 30, 2023 17:30 |
|
theres also stm and big rear end non mutex poo poo and agentic poo poo. and greenthreads which are still threading bullshit but Different
|
# ? Mar 30, 2023 17:41 |
|
Archduke Frantz Fanon posted:points aren't real and can mean whatever you want! oh don't worry, they were using dates
|
# ? Mar 30, 2023 18:18 |
|
cjs: guy who is retiring next week just sent out his farewell email with over 100 people on it, intercompany, vendors, customers. the reply alls have already started to roll in
|
# ? Mar 30, 2023 18:20 |
|
tef posted:
if you want a spearhead of determinism in a giant roiling mess of bullshit one successful thing ive seen was enforcing an associativity and commutativity property w property tests
|
# ? Mar 30, 2023 18:52 |
|
cls: crushed a finger on a doorjamb. ow
|
# ? Mar 30, 2023 19:12 |
Cat Face Joe posted:cjs: guy who is retiring next week just sent out his farewell email with over 100 people on it, intercompany, vendors, customers. the reply alls have already started to roll in He knew what he was doing lol
|
|
# ? Mar 30, 2023 20:02 |
|
cjs: struggling to learn gcloud stuff
|
# ? Mar 30, 2023 20:19 |
|
cjs: didn't do poo poo today, probs will do the same tomorrow
|
# ? Mar 30, 2023 21:01 |
|
HamAdams posted:cjs: didn't do poo poo today, probs will do the same tomorrow if it weren’t for standup this would be everyday
|
# ? Mar 30, 2023 21:17 |
|
Cybernetic Vermin posted:cjs: somehow got the funding to hire my favorite student to do a phd, hype as hell, they are way better than me at the thing i want to do i got to class a little early today and in the class that was there before me the professor had a slide up about how he needs people to... play video games for an hour+ and then answer a questionaire for his phd like their assignment was literally "play video games lol"
|
# ? Mar 30, 2023 21:25 |
|
hbag posted:i got to class a little early today and in the class that was there before me the professor had a slide up about how he needs people to... play video games for an hour+ and then answer a questionaire for his phd this student actually knows group theory and will be tasked with doing group theory though. which might honestly be a better deal as far as committing five years of your life goes.
|
# ? Mar 30, 2023 21:33 |
|
was it a specific game or
|
# ? Mar 30, 2023 21:34 |
|
Jonny 290 posted:was it a specific game or no but i think there was an emphasis on "multiplayer"
|
# ? Mar 30, 2023 21:37 |
|
space station 13 counts, right?
|
# ? Mar 30, 2023 21:51 |
|
|
# ? May 22, 2024 19:30 |
|
njs: don't even start until next week and my future boss is already asking me about going to conferences
|
# ? Mar 30, 2023 21:52 |