Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
ww520
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
64 ms
·
931.
▲
by
ww520
5y ago
The Ukrainian air capabilities are attacking the supply line, like the fuel trains on the south. The long column of Russian vehicles outside of Kiev is stuck for several days because logistics. Without fuel it's not going to be anywh
932.
▲
by
ww520
5y ago
Colleges admitting Asians with on sport scholarship is very low. By your logic, colleges should take away sport scholarship admission for other groups and grant them to Asians so that 1. fixes the low admission of other groups based on aca
933.
▲
by
ww520
5y ago
Asians are way under represented in sport teams. Who will be held accountable?
934.
▲
by
ww520
5y ago
Make it require 5 years tax returns.
935.
▲
by
ww520
5y ago
Getting rid of the legacy admission system would help equality. Legacy admission is for preserving the generational class structure and keeping the disadvantaged down.
936.
▲
by
ww520
5y ago
I uses a tristate flag: system, light, and dark modes.
937.
▲
by
ww520
5y ago
The scale of efficiency saving on society due to computer usage is probably 1 million to 1.
938.
▲
by
ww520
5y ago
This is great. I tried it and found the traffic tickets I got.
939.
▲
by
ww520
5y ago
For static data would it be faster to use a trie or radix tree?
940.
▲
by
ww520
5y ago
I have the same setup. One question, is there a Syncthing solution for iOS devices?
941.
▲
by
ww520
5y ago
Please don’t add notification for replies. It will ruin the site. It will have a lot more garbage replies when people are compelled to reply due to gamification. It will make moderation more difficult. Not worth it.
942.
▲
by
ww520
5y ago
For a moment, I thought the birds are geofenced at height and thus fell down, like Icarus flying too close to the sun.
943.
▲
by
ww520
5y ago
This sounds very handy for broadcast within a box type of applications.
944.
▲
by
ww520
5y ago
It's just that the question "how do you know I’m a man?" and the response were in the training set. AI is what the training data selected for it.
945.
▲
by
ww520
5y ago
Right. Sometimes we are forced to go outside of our comfort zone. A software engineer might not care much about insurance actuary, bank money transfer, railroad signal rules, or econ supply/demand curves. But when the job calls for
946.
▲
by
ww520
5y ago
That’s what programming is. Programming is applying computerized solutions to different problem domains. To make a successful problem, you have to learn about the targeted domain and sometimes become an expert in it. In this case the probl
947.
▲
by
ww520
5y ago
Book directly with the hotels if possible. Lots of hotels will forgo the 24-hour cancellation charge if you ask nicely. Hotels can't do much if you book with a 3rd party since you're a customer of the 3rd party, not with the hot
948.
▲
by
ww520
5y ago
Lock doesn't have to sleep. The semantic of a lock is that on acquisition it blocks until it's available, and upon unblocking the caller thread has acquired the lock. The blocking can be sleep or be doing busy-spin. Futex is the
949.
▲
by
ww520
5y ago
You are right. XCHG can do the job to acquire the lock. At least on x86, XCHG does lock the cache line on the address of the variable, so it should be ok.
950.
▲
by
ww520
5y ago
Thanks for the creation! But sorry man, the historic description unfortunately added to the confusion. When I read the original description, I thought it’s a user mode lock and was thoroughly confused. Only after I read the implementation
951.
▲
by
ww520
5y ago
Futex puts the thread to sleep and wakes it up. Accessing the OS scheduler requires kernel access anyway. The memory access of the flag can be done in user or kernel space.
952.
▲
by
ww520
5y ago
What you described is what the phread_mutex_lock() does exactly, which is in user space. Application programmers don't deal with futex directly, they call phread_mutex_lock/phread_mutex_unlock.
953.
▲
by
ww520
5y ago
Yes, CMPXCHG is a relatively more expensive instruction. In x86 it is a memory barrier instruction.
954.
▲
by
ww520
5y ago
The 'lock' variable is shared among threads. Compare is needed to avoid stomping on the lock acquired by another thread.
955.
▲
by
ww520
5y ago
Good question. It's for performance reason. Calling into kernel is expensive. Lock acquired in the user mode is much faster than lock acquired in kernel. A typical lock acquisition using futex looks like: (a) while !compare_and_
956.
▲
by
ww520
5y ago
I don't think Windows has the equivalent of futex2, waiting on multiple addresses. WaitOnAddress() in Windows is the equivalent of futex, waiting on a single address. WaitForMultipleObjects() in Windows is for acquiring multiple locks
957.
▲
by
ww520
5y ago
It's important to remember that futex is not a lock; it is a conditional sleeping operation. Its name unfortunately looks similar to mutex but it's not a lock. A thread calls futex(&flag, FUTEX_WAIT) to sleep. The kernel wak
958.
▲
by
ww520
5y ago
Background noise can be used to identify location and device association.
959.
▲
by
ww520
5y ago
The Little Prince. Ages young and old will get something out of it.
960.
▲
by
ww520
5y ago
What's your thought on TreeMap (ordered by key)? What problems can be best solved by TreeMap? Why do people use HashMap instead of TreeMap?
More ›