DEV Community

Discussion on: Avoiding Race Conditions when Fetching Data with React Hooks

Collapse
 
dimpiax profile image
Dmytro Pylypenko

It's not a race condition, as here, and in React, is nothing about threads.
Reusing such phrases in the wrong context – investment for making people to understand things in messed way.

Collapse
 
n1ru4l profile image
Laurin Quast

Why would you not call this a race condition? Why would race conditions not occur in an event loop environment?

Collapse
 
nas5w profile image
Nick Scialli (he/him)

I have heard some people make the argument that race conditions can only happen in multithreaded environments by definition. I don’t really agree (or think it matters) as you’ll find plenty of people out there who would contend that multithreading is not required to be a race condition. At any rate, I’m not terribly interested in calling it a “condition in which there is a race” just to avoid what some might consider a reserved phrase.

Collapse
 
jsamr profile image
Jules Sam. Randolph

Race conditions can occur especially in logic circuits, multithreaded, or distributed software programs.

Moreover, the expression was coined by David A. Huffman in the area of logic circuits, so it would also be historically irrelevant to restrict its meaning to multithreading.

Source: en.wikipedia.org/wiki/Race_condition

Collapse
 
dimpiax profile image
Dmytro Pylypenko

Right! Thanks for the link :)