|
WHOIS John Galt posted:i'm a really lovely programmer and i've never really explicitly used concurrency or multithreading in anything. what on earth would i use that poo poo for. like the goroutines+channels seem really cool but i can't figure out why i'd use them, especially when it seems like so much poo poo goes wrong in concurrent programming im guessing you would use them if you need to do more than one thing at a time??
|
# ? Oct 12, 2012 05:15 |
|
|
# ? Jun 13, 2024 05:27 |
|
probably the most common example in application programming nowadays is making a request to a web service without locking up the entire application
|
# ? Oct 12, 2012 05:16 |
|
I guess not freezing the entire ui while waiting for user input is a nice thing
|
# ? Oct 12, 2012 05:23 |
|
rotor posted:I guess not freezing the entire ui while waiting for user input is a nice thing waht
|
# ? Oct 12, 2012 05:24 |
|
rotor posted:I guess not freezing the entire ui while waiting for user input is a nice thing user... input??? who has that
|
# ? Oct 12, 2012 06:12 |
|
if you have to ask you'll never gnu
|
# ? Oct 12, 2012 06:16 |
|
tef posted:your challenge is to stop posting Can I start posting now?
|
# ? Oct 12, 2012 06:56 |
|
What should the other 3 cores on my laptop be doing if I've maxed the first core? Provide emotional support? I peg all 24 cores on my workstation regularly...
|
# ? Oct 12, 2012 07:00 |
|
Meiwaku posted:What should the other 3 cores on my laptop be doing if I've maxed the first core? Provide emotional support? they should be turning themselves off to allow the processor to raise the clock speed on the one core that's doing work, which is what modern intel processors do
|
# ? Oct 12, 2012 07:04 |
|
Meiwaku posted:What should the other 3 cores on my laptop be doing if I've maxed the first core? Provide emotional support? seti @ home dude
|
# ? Oct 12, 2012 07:06 |
|
^^^ that, or code to use all N-cores so work can complete ~N times faster. Intel jumps through a lot of hoops since many developers seem incapable of adjusting to major shifts in hardware. Hell, even cellphones have 2-4 cores now.
|
# ? Oct 12, 2012 07:44 |
|
How to write a multithreaded application: 1) Just make your application single-threaded 2) Copy this bat file as many times as you have processors, with different parameters in each file, duh: DOS code:
DOS code:
|
# ? Oct 12, 2012 08:10 |
Otto Skorzeny posted:also ocaml is a pretty darn good language for writing a compiler in gently caress yeah ocaml rules
|
|
# ? Oct 12, 2012 11:10 |
Wheany posted:How to write a multithreaded application: how to stop Wheany posting: 1) stop posting 2) stop it 3) ??? 4) ge tout
|
|
# ? Oct 12, 2012 11:12 |
|
Wheany posted:How to write a multithreaded application: learn to xargs
|
# ? Oct 12, 2012 11:32 |
|
vapid cutlery posted:probably the most common example in application programming nowadays is making a request to a web service without locking up the entire application mumble mumble node.js
|
# ? Oct 12, 2012 13:03 |
|
Mr Dog posted:mumble mumble node.js mumble mumble gar1t on youtube
|
# ? Oct 12, 2012 13:24 |
|
Meiwaku posted:What should the other 3 cores on my laptop be doing if I've maxed the first core? Provide emotional support? I'll peg your 24 corse
|
# ? Oct 12, 2012 13:31 |
|
WHOIS John Galt posted:the goroutines+channels seem really cool but i can't figure out why i'd use them, especially when it seems like so much poo poo goes wrong in concurrent programming concurrent programming introduces a whole load of new considerations and possible pitfalls but using a language with decent high level concurrency primitives ameliorates that somewhat
|
# ? Oct 12, 2012 13:45 |
|
idk its like if you always want to ride a pushbike thats fine but if you want to drive a car you should def get one with at least 3 wheels and working brakes, car anal ogy
|
# ? Oct 12, 2012 13:46 |
|
|
# ? Oct 12, 2012 13:51 |
|
if you don't know what concurrency etc. is good for, i don't really know what to say to you in words that you would understand, because you are clearly a homosexual retarded baby clown who was born in the circus
|
# ? Oct 12, 2012 13:50 |
|
I'm due for a carepost on why node.js is a terrible idea. Let's say I'm writing a server app decades ago. I start from scratch, on a computer with a single core. I first write my little socket acceptor dealing with TCP stuff. It opens a listen socket, waits to accept a connection, and then parses the request, dispatches it to some library function I have written, which goes fetch the data, builds the page that will result in it, then push it to the client. I then go back and accept another connection. This gives me an execution model a bit like that: code:
code:
code:
code:
Then at some point, computer evolution allows us to have things like threads and processes, and other proper concurrency mechanisms. By making things fork, go parallel, go async, or whatever after accepting, I'm able to serve two queries at once, without special care. If I have only my one processor with one core, then it will transform: code:
code:
code:
code:
Then at some point, I may gain parallelism on top of it Awesome, poo poo will go great, except maybe my writes, which will need to block to be sane. What I'll be able to do with my concurrent code (not callback-based) is: code:
code:
code:
While the modern world of programming on servers has moved to concurrent and parallel methods a long while ago (mostly because they are objectively better), Javascript users with node.js came crashing through the door and said "we have a great new model! it's callbacks with non-blocking IO! it's loving great!". Everyone who is not node.js knows what they propose is worse than what exists. It's like someone inventing PHP again, but for server-side platforms. Node still has a decent community, interesting libraries, documentation, etc. In some cases better than many other communities and libraries. Parallel and concurrent code still is tricky to write without high-level constructs to keep you from having deadlocks, memory corruption, etc. and requires a lot of discipline otherwise. This changes nothing to the fact that the underlying model of node.js is still outdated garbage. It's the worst of both world. MononcQc fucked around with this message at 14:11 on Oct 12, 2012 |
# ? Oct 12, 2012 14:08 |
|
i still dont understand what benefit ur getting out of node.js there. you get to use a bad language? is that the benefit?
|
# ? Oct 12, 2012 14:13 |
|
it helps if you keep shouting "non blocking" and "web scale" while ignoring everyone else
|
# ? Oct 12, 2012 14:15 |
|
MononcQc posted:I'm due for a carepost on why node.js is a terrible idea. Nice!
|
# ? Oct 12, 2012 14:16 |
|
Shaggar posted:i still dont understand what benefit ur getting out of node.js there. you get to use a bad language? is that the benefit? you know how to use a knife, so you bring a knife to a modern war fought with guns, tanks, and missiles while shouting "at least I can use the same tools when I eat and when I fight! I save so much time!" before somehow managing to shoot yourself in the foot anyway.
|
# ? Oct 12, 2012 14:19 |
|
Meiwaku posted:^^^ that, or code to use all N-cores so work can complete ~N times faster. Intel jumps through a lot of hoops since many developers seem incapable of adjusting to major shifts in hardware. it's dumb that developers should have to write weird code just because the only way intel can make better processors is to jam more tiny mini-processors into them
|
# ? Oct 12, 2012 14:25 |
|
MononcQc posted:you know how to use a knife, so you bring a knife to a modern war fought with guns, tanks, and missiles while shouting "at least I can use the same tools when I eat and when I fight! I save so much time!" before somehow managing to shoot yourself in the foot anyway. in this scenario java is a carrier
|
# ? Oct 12, 2012 14:30 |
|
Shaggar posted:in this scenario java is a carrier huge, slow, and clunky
|
# ? Oct 12, 2012 14:34 |
|
MononcQc posted:you know how to use a knife, so you bring a knife to a modern war fought with guns, tanks, and missiles while shouting "at least I can use the same tools when I eat and when I fight! I save so much time!" before somehow managing to shoot yourself in the foot anyway. Also the knife is blunt.
|
# ? Oct 12, 2012 14:34 |
|
Shaggar posted:in this scenario java is a carrier an armored personnel carrier. tinfoil for armor, no gun to speak of, shoehorned into a billion tasks it isn't good at because hey common chassis saves money
|
# ? Oct 12, 2012 15:07 |
|
Otto Skorzeny posted:an armored personnel carrier. tinfoil for armor, no gun to speak of, shoehorned into a billion tasks it isn't good at because hey common chassis saves money thats python. people like to think its a replacement for java when its an unfinished piece of poo poo for retards. java is the ultimate in utility and can project its power anywhere it likes.
|
# ? Oct 12, 2012 15:09 |
|
Shaggar posted:in this scenario java is a carrier
|
# ? Oct 12, 2012 15:10 |
|
the wide variety of weaponry onboard a carrier is the equivilent of java frameworks and libraries. we've got what you need for any situation.
|
# ? Oct 12, 2012 15:11 |
|
and everyone likes to think its a dead or archaic tool, but in reality its still the best and nothing can come close.
|
# ? Oct 12, 2012 15:12 |
|
its a battleship analogy
|
# ? Oct 12, 2012 15:13 |
|
in the midst of all this there are the php programmers the huge teetering tricicles armed with lances and stacked with clowns
|
# ? Oct 12, 2012 15:13 |
|
php are makeshift rafts people use to flee the 3rd world. they know its risky, but it only needs to work once and then they can move on to better things. no one would try to reuse the raft.
|
# ? Oct 12, 2012 15:16 |
|
|
# ? Jun 13, 2024 05:27 |
|
MononcQc posted:you know how to use a knife, so you bring a knife to a modern war fought with guns, tanks, and missiles while shouting "at least I can use the same tools when I eat and when I fight! I save so much time!" before somehow managing to shoot yourself in the foot anyway. hahahahaha
|
# ? Oct 12, 2012 15:17 |