Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
jjnoakes
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
74 ms
·
841.
▲
by
jjnoakes
10y ago
> It should not be misleading to reveal only the minimum information necessary to a potentially hostile actor I have no problem with this. But I see a big difference between asking one's employer "If I was already working on a
842.
▲
by
jjnoakes
10y ago
Please don't advocate for making willfully misleading statements to one's employer which might have legal repercussions (IANAL, etc).
843.
▲
by
jjnoakes
10y ago
> I learnt this stuff in a C++0x draft, and it has been notably improved. I guess the lesson is: don't yell at people if you aren't up-to-date on what you are yelling about :)
844.
▲
by
jjnoakes
10y ago
The issue has nothing to do with fork or exec; if you have two threads in a process, and one calls setenv() while another calls getenv(), you can hit this issue.
845.
▲
by
jjnoakes
10y ago
> This topic is about C and only about C. All other talk is "noise". Why do you get to decide? There are a lot of people in this thread talking about similar issues in other languages (Python, Rust, etc) and other functions (li
846.
▲
by
jjnoakes
10y ago
> When you pass it to execlp, it just gets pushed through as a bit-pattern No, it doesn't. It goes through a proper conversion to a pointer. > [passing nullptr and getting 0 out of va_arg is] not required behaviour by the standar
847.
▲
by
jjnoakes
10y ago
That isn't the shell considering the output one per line. ls will change the way it writes its output if it detects that stdout is a tty versus a pipe or redirect.
848.
▲
by
jjnoakes
10y ago
I don't immediately see the vast difference between ranking fast sights higher and ranking slow sites lower. Clue me in please.
849.
▲
by
jjnoakes
10y ago
"Their" is not always plural.
850.
▲
by
jjnoakes
10y ago
If you want to say "John has a flower", saying "his flower smells good" is fine. But try it with "Someone has a flower. Their flower smells good." Sounds right to me. There's no need to replace one with th
851.
▲
by
jjnoakes
10y ago
The English language does. https://en.oxforddictionaries.com/definition/their https://www.merriam-webster.com/dictionary/their
852.
▲
by
jjnoakes
10y ago
> Let's say I am using JNA. [...] It is not safe to call fork. Are you calling fork() from Java, from C, or using the system call number? Because I'd agree calling it from Java might be unsafe (depends on how Java and JNA inter
853.
▲
by
jjnoakes
10y ago
> Another issue is that fork-and-exec doesn't work well with languages with complicated runtimes How are you doing fork-and-exec in a language with a large runtime? You are either using the language-provided APIs to do it, in which
854.
▲
by
jjnoakes
10y ago
You think if someone goes hunting with my gun and commits murder instead, I'm an accessory to murder?
855.
▲
by
jjnoakes
10y ago
Programs have features because they are useful. Some features may not fit your view of what the philosophy should dictate, and that's OK. Having a recursive ls doesn't bother me for example. Fork-and-exec isn't complicated by
856.
▲
by
jjnoakes
10y ago
Like I said, there are some valid arguments on both sides. But a blanket "signals are garbage" is not useful or correct.
857.
▲
by
jjnoakes
10y ago
Most of the statements aren't really conducive to rebuttals because they are lacking substance. But I can imagine what xenadu02 might have meant, if you like, and provide some counter arguments. Signals aren't "garbage"
858.
▲
by
jjnoakes
10y ago
Most of this comment is incorrect.
859.
▲
by
jjnoakes
10y ago
Why is that React Native's fault?
860.
▲
by
jjnoakes
10y ago
Why do you need a Mac...?
861.
▲
by
jjnoakes
10y ago
You probably know, but for others reading these threads: volatile is not the optimal way (and usually it isn't even a correct way, outside of very specific code) to synchronize variables across threads.
862.
▲
by
jjnoakes
10y ago
Thanks for the details. If you are reading from a shared variable like that you most definitely need to be careful about using macros. I would be concerned if I wasn't using some sort of read_once routine or macro (like a sister commen
863.
▲
by
jjnoakes
10y ago
I see. So you are relying on single-reads of your shared variables. They must be suitably defined to be atomic on your architecture (so no word-tearing, out-of-order visibility), etc. I would think that if you had all the proper barriers in
864.
▲
by
jjnoakes
10y ago
Your bug doesn't seem to be related to the 'min' macro, but to the fact that your lock-free algorithm is not actually lock-free: if one thread can update an 'availableData' variable while another thread can read it,
865.
▲
by
jjnoakes
10y ago
Sure, but this can be the same in Rust or C, which was the context of this discussion. New languages may provide more tools to eliminate more checks, but in general, if you have a runtime value and you index an array with it, someone has to
866.
▲
by
jjnoakes
10y ago
> let's not act like there is no choice in C If you are using gcc or clang, you have more options. True. But not all C compilers give you those options. However, the point is moot, since I never said you can't catch these thing
867.
▲
by
jjnoakes
10y ago
What do you expect a language to do if you index an array using a runtime-calculated value? Rust checks at runtime and panics if your program exceeds the bounds. You can opt-in to asking if the bounds are exceeded and fail gracefully if you
868.
▲
by
jjnoakes
10y ago
That is done already in many cases. Note that doing that doesn't fix all of the problems that out of bounds array writes can cause though.
869.
▲
by
jjnoakes
10y ago
You are equating the unsafe keyword in Rust with entire C codebase. Yes, carelessness in either could amount to trouble. No, they are not close to the same amount of risk because the relative amount of code in each is orders of magnitude di
870.
▲
by
jjnoakes
10y ago
The contents of the email contain an argument against this approach.
More ›