Poll of the Day > fuck race conditions.

Topic List
Page List: 1
Judgmenl
11/01/19 5:55:34 PM
#1:


If you're writing software and your API tells me you're done processing a command you better fucking be done processing that command.
---
You're a regular Jack Kerouac
... Copied to Clipboard!
keyblader1985
11/01/19 6:04:21 PM
#2:


Don't get me started on inclement weather.
---
Official King of PotD
You only need one T-Rex to make the point, though. ~ Samus Sedai
... Copied to Clipboard!
SunWuKung420
11/01/19 6:55:03 PM
#3:


Some of the races are on difficult courses.
---
Align your chakras, it starts with your breathing.
http://www.arfalpha.com/ScienceOfBreath/ScienceOfBreath.htm
... Copied to Clipboard!
Judgmenl
11/01/19 7:01:47 PM
#4:


Here: https://en.wikipedia.org/wiki/Race_condition
---
You're a regular Jack Kerouac
... Copied to Clipboard!
captpackrat
11/01/19 7:57:26 PM
#5:


Rainbow Road is always the hardest.
---
Minutus cantorum, minutus balorum,
Minutus carborata descendum pantorum.
... Copied to Clipboard!
Lokarin
11/01/19 8:01:09 PM
#6:


I don't understand the usage of race in this context.
---
"Salt cures Everything!"
My YouTube: https://www.youtube.com/user/Nirakolov/videos
... Copied to Clipboard!
Zikten
11/01/19 8:06:19 PM
#7:


Yea Allied Races are bullshit. Just let me play them if I bought the expansion. None of this reputation grinding bullshit
... Copied to Clipboard!
Kimbos_Egg
11/01/19 8:19:55 PM
#8:


my race is harder than yours
---
You think you've Got problems?
https://imgur.com/vgckRUN
... Copied to Clipboard!
captpackrat
11/01/19 9:06:24 PM
#9:


Probably one of the most infamous failures involving a race condition was the Therac-25, a radiation therapy machine. If the operator selected the wrong mode then changed it within a few seconds, it could set off a race condition in the computer that could fire the machine at 100 times the normal dose of beta radiation. Three patients died from radiation poisoning, others suffered radiation burns.
---
Minutus cantorum, minutus balorum,
Minutus carborata descendum pantorum.
... Copied to Clipboard!
Sahuagin
11/02/19 12:15:45 AM
#10:


Lokarin posted...
I don't understand the usage of race in this context.

if you use multi-threading, or other scenarios where the same code can be executed more than once simultaneously by two difference threads/processes, the actual order in which the instructions execute is unknown (each execution context will occur in its own order, but they will all be interleaved together in some random way). in particular this means that you can't rely on a read of a variable staying true until the next instruction (at least if there are also writes to that variable, which is one reason why immutability (readonly variables) is desirable). race condition specifically is saying "whoever gets there first wins", and the problem is you never know who will get there first.
---
... Copied to Clipboard!
Yellow
11/02/19 12:22:16 AM
#11:


Seems like a multi-threading problem? God, my last multi-threading project was a nightmare. I actually gave up. Not something to throw in as an afterthought.

---
... Copied to Clipboard!
Lokarin
11/02/19 12:39:29 PM
#12:


Sahuagin posted...
Lokarin posted...
I don't understand the usage of race in this context.

if you use multi-threading, or other scenarios where the same code can be executed more than once simultaneously by two difference threads/processes, the actual order in which the instructions execute is unknown (each execution context will occur in its own order, but they will all be interleaved together in some random way). in particular this means that you can't rely on a read of a variable staying true until the next instruction (at least if there are also writes to that variable, which is one reason why immutability (readonly variables) is desirable). race condition specifically is saying "whoever gets there first wins", and the problem is you never know who will get there first.


Interesting, but it seems like outcome dependent events should be single-threaded for that exact reason... even if it creates a small bottleneck for the multithreading events before it
---
"Salt cures Everything!"
My YouTube: https://www.youtube.com/user/Nirakolov/videos
... Copied to Clipboard!
Judgmenl
11/02/19 12:59:25 PM
#13:


Lokarin posted...
Interesting, but it seems like outcome dependent events should be single-threaded for that exact reason... even if it creates a small bottleneck for the multithreading events before it


You cannot guarantee that everything is single threaded.
Also you do not want everything to be single threaded.
I am currently integrating with a third party application. Basically I tell it to do something (Send this file to this place) and then I tell it to stop sending files after I believe it's completed. The problem is that I have no way to tell its completed (beyond the fact that my file is no longer there. I either have to wait a period of time (This is NEVER a good idea) and then tell it to stop, or I have to find some way to ask it if it has done transferring my file.
As far as I can tell there's no way to ask it if it's done transferring my file.
---
You're a regular Jack Kerouac
... Copied to Clipboard!
Lokarin
11/02/19 1:05:00 PM
#14:


Judgmenl posted...
Lokarin posted...
Interesting, but it seems like outcome dependent events should be single-threaded for that exact reason... even if it creates a small bottleneck for the multithreading events before it


You cannot guarantee that everything is single threaded.
Also you do not want everything to be single threaded.
I am currently integrating with a third party application. Basically I tell it to do something (Send this file to this place) and then I tell it to stop sending files after I believe it's completed. The problem is that I have no way to tell its completed (beyond the fact that my file is no longer there. I either have to wait a period of time (This is NEVER a good idea) and then tell it to stop, or I have to find some way to ask it if it has done transferring my file.
As far as I can tell there's no way to ask it if it's done transferring my file.


I'm a dullard, but maybe this will help?

https://www.youtube.com/watch?v=IP-rGJKSZ3s
---
"Salt cures Everything!"
My YouTube: https://www.youtube.com/user/Nirakolov/videos
... Copied to Clipboard!
Judgmenl
11/02/19 1:16:47 PM
#15:


Lokarin posted...
I'm a dullard, but maybe this will help?


People who aren't me should write better code so I can actually interface with them.
---
You're a regular Jack Kerouac
... Copied to Clipboard!
Sahuagin
11/02/19 5:30:43 PM
#16:


Lokarin posted...
Interesting, but it seems like outcome dependent events should be single-threaded for that exact reason... even if it creates a small bottleneck for the multithreading events before it

any time two processes try to share a resource (usually memory), the same problems emerge, so it doesn't necessarily require multi-threading

Judgmenl posted...
You cannot guarantee that everything is single threaded.
Also you do not want everything to be single threaded.
I am currently integrating with a third party application. Basically I tell it to do something (Send this file to this place) and then I tell it to stop sending files after I believe it's completed. The problem is that I have no way to tell its completed (beyond the fact that my file is no longer there. I either have to wait a period of time (This is NEVER a good idea) and then tell it to stop, or I have to find some way to ask it if it has done transferring my file.
As far as I can tell there's no way to ask it if it's done transferring my file.

what language and API?

not the best solution, but a starting point, can you just spin with "while file exists" or something?

are you sure there isn't a callback function you can pass, or a promise or something (or use await, depending on the language)?
---
... Copied to Clipboard!
Sahuagin
11/02/19 5:39:26 PM
#17:


Lokarin posted...
I'm a dullard, but maybe this will help?

that problem seems more related to networking. at lower levels, sending packets uses UDP (nicknamed "unreliable data protocol") where there is never a guarantee that anything you send will be received at the other end, and in fact you will never know if it was or wasn't received.

built on top of this is TCP, which is a reliable protocol and has features designed to fix this issue. (in particular, confirmations that messages are being received, as well as timeouts so that if a confirmation is missed, the message can be sent again, as well as sequence numbers so that messages arriving out of order or with duplicates can always be properly assembled and any missing pieces can be re-requested.)
---
... Copied to Clipboard!
Judgmenl
11/03/19 6:27:43 PM
#18:


Sahuagin posted...
what language and API?

not the best solution, but a starting point, can you just spin with "while file exists" or something?

are you sure there isn't a callback function you can pass, or a promise or something (or use await, depending on the language)?


I'm doing REST stuff (Well the RPCs are REST based at least) in Python.
Anyways, I think the problem was that I was restarting their application too much. I am generating different configurations and restarting. Seems to not like multiple restarts within 10 seconds of each other.
My main tech stack right now is Python/C/Go.
---
You're a regular Jack Kerouac
... Copied to Clipboard!
Krazy_Kirby
11/03/19 9:38:56 PM
#19:


i agree, fuck affirmative action
---
... Copied to Clipboard!
Sahuagin
11/03/19 9:52:10 PM
#20:


Judgmenl posted...
I'm doing REST stuff (Well the RPCs are REST based at least) in Python.
Anyways, I think the problem was that I was restarting their application too much. I am generating different configurations and restarting. Seems to not like multiple restarts within 10 seconds of each other.

I dunno if it's worth asking since I can't see what you're doing, and I don't have tons of experience with REST, but for the sake of conversation and interest, shouldn't this REST API be running on a server or something? why are you restarting it at all? shouldn't it be a service?
---
... Copied to Clipboard!
AwesomeTurtwig
11/03/19 9:59:17 PM
#21:


My product at work in multi-threaded and it is a pain to manage.
---
... Copied to Clipboard!
jramirez23
11/03/19 10:12:25 PM
#22:


Code is scary stuff!

---
When life backs you up into a corner, come out swingin'!
... Copied to Clipboard!
zebatov
11/03/19 10:47:39 PM
#23:


Krazy_Kirby posted...
i agree, fuck affirmative action

This is called employment equity in Canada, and only applies federally. I always thought you were English for some reason.
---
"Her name is fitting."
... Copied to Clipboard!
Topic List
Page List: 1