Posts

This profile is from a federated server and may be incomplete. Browse more on the original instance.

shachaf, to random EN
@shachaf@y.la avatar

An interesting concurrency operation that @tavianator mentioned is "acquire a lock and immediately release it". I've seen this in another context before.
I sort of wonder whether this is trying to be some other serialization operation, or what the simplest version of this is.

pervognsen,
@pervognsen@mastodon.social avatar

@shachaf @tavianator It's just an acquire-release sync point, no?

shachaf, to random
@shachaf@y.la avatar

If you find yourself acquiring a lock just because the condition variable API requires you to have a lock, and not using it anywhere else, you should probably reconsider what you're doing.

pervognsen,
@pervognsen@mastodon.social avatar

@shachaf Eventcount!

shachaf, to random EN
@shachaf@y.la avatar

When people advertise software as "written in X", I usually take that as a slightly negative signal (you don't have something more interesting than the language you used?). The main exception is Go, where it means there's a good chance they ship a simple static binary.

pervognsen,
@pervognsen@mastodon.social avatar

@shachaf Software or libraries? For libraries I do care. If they're written in C, they can be consumed from any language with relatively little effort. If they're written in X and I'm also using X, likewise.

shachaf, to random EN
@shachaf@y.la avatar

I liked @ptrschmdtnlsn's explanation for what's going on with Fibonacci vs. Galois LFSRs: Say you want to compute Fibonacci numbers (or some other linear recurrence). You have an infinite array of mutable cells, F[i], zero-initialized except F[0] = F[1] = 1

shachaf, to random EN
@shachaf@y.la avatar

Apparently even asm(""); is treated as some sort of compiler barrier for clang, causing it to spill registers to memory.
https://godbolt.org/z/G3c778WqE

pkhuong,

@shachaf that's unextended inline asm, with an implicit memory (and cc, I think registers are assumed preserved?) clobber. Compare with asm("":::).

shachaf, to random EN
@shachaf@y.la avatar

Is there a good overview reference for concurrent memory reclamation -- potential issues (ABA, use-after-free), and approaches people use (GC, epochs, hazard pointers, RCU-style read locks, etc.) and tradeoffs between them?

pervognsen,
@pervognsen@mastodon.social avatar

@shachaf Tom Hart's thesis had a survey but it's not exhaustive.

shachaf, to random EN
@shachaf@y.la avatar

Part of an email I wrote last year. I still think there are a lot of interesting unexplored points in this space!

demofox,
@demofox@mastodon.gamedev.place avatar

@shachaf yeah it's weird. There is power in making a language etc. that makes maximum sense to the hardware and then forcing everyone into that paradigm. There is also power in writing custom functionality for your specific need. Folks tout the efficiency of databases, but you will be hard pressed to find a game that uses one for data or assets (outside of mmos), and there's a real reason for that regarding efficiency.

shachaf, to random EN
@shachaf@y.la avatar

In practice, is it reasonable to sometimes do an atomic exchange/store on 16 bits of a 32-bit value, and sometimes do CAS on the whole value? I assume it's not incorrect, but will the store buffer get mad at me and use some awful slow path? What about if the former case is rare?

pkhuong,

@shachaf sounds similar to linux's old ticket spinlock. Blessed by intel and amd in 2007.

shachaf, to random
@shachaf@y.la avatar

How to think of the trace of a linear map as connecting its output back to its own input https://math.stackexchange.com/q/2762669

pervognsen, (edited )
@pervognsen@mastodon.social avatar

@shachaf The trace of a rank 1 operator f = u v^T is Tr(u v^T) = v^T u. Since v^T is the "input part" and u is the "output part" of f this provides another way to think about how the trace connects the output of an operator back to its own input. Here I'm just using v^T as "abstract matrix notation" for a linear functional, so no inner product or basis is assumed.

shachaf, to random
@shachaf@y.la avatar

I didn't realize Fib_(n+m) = Fib_(n-1) Fib_(m-1) + Fib_n Fib_m. That's a nice property of linear recurrences!

pervognsen, (edited )
@pervognsen@mastodon.social avatar

@shachaf Have you seen the bijective proof of that formula based on tilings? It's very simple and pretty.

pervognsen, (edited )
@pervognsen@mastodon.social avatar

@shachaf You can define F(n) as the number of tilings of a 1xn board (n-tilings) with 1x1 tiles (1-tiles) and 1x2 tiles (2-tiles). Then an (m+n)-tiling comes in two cases based on whether or not a 2-tile bridges the m part and the n part. If there's a 2-tile bridge then there's a m-1 remainder in the m part and a n-1 remainder in the n part, hence the F(m-1) F(n-1) term. Else it's a clean split and you get the F(m) F(n) term.

shachaf, to random
@shachaf@y.la avatar

Is there a way to convince clang/LLVM to do 16-byte atomic loads with SSE instead of lock cmpxchg16b?

pkhuong,

@pervognsen @shachaf Wait, when did we get that guarantee? Intel only, I guess?

rygorous,
@rygorous@mastodon.gamedev.place avatar

@pkhuong @pervognsen @shachaf I don't thing it's even in the manuals, it was a gentleman's agreement on LKML or something along those lines.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • provamag3
  • Durango
  • DreamBathrooms
  • modclub
  • magazineikmin
  • InstantRegret
  • khanakhh
  • Youngstown
  • everett
  • slotface
  • rosin
  • mdbf
  • kavyap
  • thenastyranch
  • JUstTest
  • ethstaker
  • cisconetworking
  • normalnudes
  • osvaldo12
  • tacticalgear
  • ngwrru68w68
  • GTA5RPClips
  • cubers
  • anitta
  • megavids
  • tester
  • Leos
  • lostlight
  • All magazines