synthetigram
|
2 years ago
|
on: JEP Draft: Deprecate memory-access methods in sun.misc.unsafe for removal
You might be correct, but it's not obvious to me unsafe is really faster. I recall reading that using unsafe invalidates most of the other optimizations because it's opaque to the JIT what you are doing. Also, if there are BCE opportunities, I feel pretty confident OpenJDK will add them, rather than being unsympathetic.
synthetigram
|
2 years ago
|
on: We switched to Java 21 virtual threads and got a deadlock in TPC-C for Postgres
This problem is not going to go away so easily. Numerous core Java classes (like BufferedInputStream) use synchronized. I count 1600+ usages in java.base. The blocking issue means it's _much_ easier to accidentally run into this, rather than waving it away as an unlikely edge case.
I personally ran into this Using the built in com.sun webserver, with a virtual thread executor. My VPS only has two CPUs which means the FJP that virtual threads run on only have 2 active threads at a time. I ran into this hang when some of the connection hung, blocking any further requests from being processed.
synthetigram
|
2 years ago
|
on: Cap'n Proto 1.0
After exploring a few constant access serialization formats, I had to pass on Capn Proto in favor of Apache Avro. Capn has a great experience for C++ users, but Java codegen ended up being too annoying to get started with. If Capn Proto improved the developer experience for the other languages people write, I think it would really help a lot.
synthetigram
|
2 years ago
|
on: Goroutines: The concurrency model we wanted all along
The StreamObserver API came at a time (2015) when it seems liked RxJava was going to take over. That didn't end up happening, but the API is still around. While it is more cumbersome, some things are /impossible/ to do with the Go style blocking. For example, try cancelling out of a Recv() call. The only way is to tear the entire Stream down. Goroutines never successfully married select {} and sync.Cond, or context Cancel. These are needed to successfully back out of a blocking statement. Unfortunately, that can't be done, and a goroutine that blocks is really stuck there. The only saving grace is that goroutines are relatively cheap (2-4K of memory?), and it's okay if a few O(100K) of them get stuck.
synthetigram
|
2 years ago
|
on: Is it time to stop using sentinel values for null / “NA” values? (2018)
This is impractical a lot of the time. There are a class of problems where you want to put 2^N + 1 possible values in an N bit container, and it won't ever fit cleanly. Null is that 1 extra value that won't fit cleanly.
Another case is an array based queue. It can be implemented with head+tail pointers, or size+offset. However, there will always be an ambiguity with either, because two words of memory aren't enough to represent all possible states of the queue.
synthetigram
|
2 years ago
|
on: WebAssembly Tail Calls
What isn't clear to me is why tail calls need to be implemented in WASM, rather than in the compiler? The post linked to Josh Habermans post on tail calls, which show how tail calls can help the compiler decide where to inline (cool!). But that was needed for the C++ text, not the LLVM code. It feels like tail calls are too high level of a concept to be in an "assembly" language.
synthetigram
|
3 years ago
|
on: Intel plans thousands of job cuts in face of PC slowdown
> After the quarterly report on October 27, nothing better can be expected.
How to tell an article is written by a hedge fund shorting the company.
synthetigram
|
3 years ago
|
on: Ask HN: What's Happening at Cloudflare?
Cloudflare is great at blogging about technologies Google pioneered.
synthetigram
|
3 years ago
|
on: You don’t want to be on Cloudflare’s naughty list
Reputation systems should be based on /abuse/, not on automation. I also ended up on the naughty list for running an archival scraping program. Trying to preserve part of the Internet is apparently against the rules. It's really a shame because my code honors rate limits, doesn't spam, and is completely docile.
synthetigram
|
3 years ago
|
on: You don’t want to be on Cloudflare’s naughty list
Cloudflare has mixed up the definitions of "bot" and "abuse". Tor users may or may not be bots, but as long as they don't abuse (spamming or DoS), they ought to be treated the same.