freenode/#clasp - IRC Chatlog
Search
23:44:54
drmeister
I was reading that wiki page and I was watching a couple of lectures on designing operating systems where they described Read-Copy-Update.
23:46:12
drmeister
I don't know, I thought if I don't declare things std::atomic that BAD THINGS would happen.
23:47:12
stassats
the problem with reordering is say you're changing a class from 3 slots to 5 slots, you're writing 3 to NSLOTS, then another code is iterating over all slots, it sees NSLOTS as being 5, but the slot vector isn't visible yet, and it's still holding 3 slots => error
23:47:36
drmeister
Seriously though - I thought worried about subtle race conditions that would be very difficult to debug if I don't use std::atomic.
23:49:59
drmeister
I probably can't plaster over the code with a consistent memory model at this point.
23:52:38
drmeister
I really appreciate the help here. So I'll create a ClassHolder_O class and have it store a class - I'll put those into the class-table. I'll read them without a lock (I'm nervous about this) but write to them with a lock.
23:56:12
drmeister
I don't have fences. I have pthreads mutexes and I have std::atomic and copy-and-swap.
23:58:30
stassats
i can't say that it'd be the right decision not now, but now, that's what i would've done
0:00:13
stassats
the only possible issue with this - the class itself is not decent yet, but the value will always be right
0:01:34
stassats
and you're attaching it to the symbol as well, if that works, then the wrapper cell would automagically work
0:05:27
drmeister
That just seemed way too simple. I could write the class into a slot in the symbol - that would be wasteful I guess because most symbols would not have a class.
0:05:47
drmeister
I could write it into the property list of the symbol - but people could screw with that.
0:07:29
drmeister
I'm starting to lose my train of thought. I am going to break for a bit and think about it.
0:24:18
drmeister
Hmmm, of course none of this class-holder stuff is portable - so we can't use it in the cleavir code. I'll have to talk with Bike about this.
0:28:26
drmeister
I figured out how to read the macOS Activity Monitor <sample process> output. It's really useful for figuring out what is going on.
0:33:16
stassats
if it doesn't exist you can actually stuff a function to run there, which then changes itself to run something else after it's determined what exists