Allegro.cc - Online Community

Allegro.cc Forums » Allegro.cc Comments » Thread locks too soon

This thread is locked; no one can reply to it. rss feed Print
Thread locks too soon
Chris Katko
Member #1,881
January 2002
avatar

Can lambdas contain other lambdas?!

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

Mark Oates
Member #1,146
March 2001
avatar

We should put threads in our lambdas in our threads.

--
Visit CLUBCATT.com for cat shirts, cat mugs, puzzles, art and more <-- coupon code ALLEGRO4LIFE at checkout and get $3 off any order of 3 or more items!

AllegroFlareAllegroFlare DocsAllegroFlare GitHub

amarillion
Member #940
January 2001
avatar

Our servers are still on java 7, so no lambdas for me.

bamccaig
Member #7,536
July 2006
avatar

#SelectExpand
1const string s = "\"vgdhukw!hurp!vghhQ"; 2 3new Thread(new ThreadStart( 4 () => new Thread(new ThreadStart( 5 () => { 6 var j = s.Length - 1; 7 8 for(var i=j; i>=0; i--) { 9 var thread = i; 10 11 new Thread(new ThreadStart( 12 () => { 13 while(j != thread) { 14 Thread.Sleep(100); 15 } 16 17 Func<int,char> t = o => (char) 18 (o / 30 > 1 ? o - 3 : o - 1); 19 20 Console.Write(t((int)s[j])); 21 22 if(j == 0) { 23 Console.WriteLine(); 24 } 25 26 j--; 27 })).Start(); 28 } 29 })) 30 .Start())) 31 .Start();

Bruce Perry
Member #270
April 2000

I used lambdas to make a list of numbers from 10 to 10, but I accidentally 10 10 10 10 10 10 10 10 10 10.[1]

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.

jmasterx
Member #11,410
October 2009

This text has nothing to do with the topic at hand :)

Bruce Perry
Member #270
April 2000

Whereas a normal person would ask whether this thread stops at this statement, Einstein would ask whether this statement stops at this thread.

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.

MiquelFire
Member #3,110
January 2003
avatar

I been watching this thread, but couldn't think of anything good to add.

Still can't think of anything...

---
Febreze (and other air fresheners actually) is just below perfumes/colognes, and that's just below dead skunks in terms of smells that offend my nose.
MiquelFire.red
If anyone is of the opinion that there is no systemic racism in America, they're either blind, stupid, or racist too. ~Edgar Reynaldo

jmasterx
Member #11,410
October 2009

Quote:

My fellow programmers, ask not what your thread can do for you, ask what you can do for your thread.

John Deadlock Kennedy
J.D.K

Thomas Fjellstrom
Member #476
June 2000
avatar

jmasterx said:

John Deadlock Kennedy
J.D.K

John Futex Kennedy.

J.F.K.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Bruce Perry
Member #270
April 2000

Miquel, you should definitely join this thread :)

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.

Elias
Member #358
May 2000

Noooo, don't join the thread!

--
"Either help out or stop whining" - Evert

Peter Hull
Member #1,136
March 2001

This whole thing is screwed.

Thomas Fjellstrom
Member #476
June 2000
avatar

I'd tap that.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Gideon Weems
Member #3,925
October 2003

LennyLen said:

Some of us appreciate silently.

And some of us reply silently, contributing to the problem of threads locked too soon.

Indeterminatus
Member #737
November 2000
avatar

amarillion said:

Thread locks too soon

No, YOU lock too soon. And your sister!

_______________________________
Indeterminatus. [Atomic Butcher]
si tacuisses, philosophus mansisses

Chris Katko
Member #1,881
January 2002
avatar

So is Java like... a dead language? It seems like everyone is trying to lock it away until it dies--like they're doing with Flash.

Chrome has completely disabled the previous plugin interface that all Java applets used which is sad, because I love me my 90's-era Physics Java applets.

OTOH, for a job interview with a very big company running Big Data, I was told they do everything in Java. So maybe it's still a huge corporate framework? But with all of the exploits that come out--practically every week--is that really a safe decision to base your corporate software on?

To be clear: I'm not talking about the merits of the features of the language at all.

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

bamccaig
Member #7,536
July 2006
avatar

The platform and language are extremely popular for Web applications and server-side applications. And probably internally for desktop software. Many companies, such as Google, use it as one of their primary technologies. I imagine that the majority of vulnerabilities mostly affect desktop and browser-based installations. Java remains to be very big.

MiquelFire
Member #3,110
January 2003
avatar

Basically, plug stuff is being removed as most exploits use that to infect systems.

---
Febreze (and other air fresheners actually) is just below perfumes/colognes, and that's just below dead skunks in terms of smells that offend my nose.
MiquelFire.red
If anyone is of the opinion that there is no systemic racism in America, they're either blind, stupid, or racist too. ~Edgar Reynaldo

Thomas Fjellstrom
Member #476
June 2000
avatar

Java is as dead as C and Perl. Ie: NOT. It's just not hip.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Elias
Member #358
May 2000

The one thing basically all the programming language statistics seem to agree on is that right now Java is the most popular. E.g. up at the top together with Javascript as most questions asked in 2015 on stackoverflow [1], same with most used language on github [2] or some other weighted statistics like [3] or [4].

--
"Either help out or stop whining" - Evert

Thomas Fjellstrom
Member #476
June 2000
avatar

Given there are billions of Android devices, and probably dozens of fortune 500 companies and governments employing (tens of?) thousands of java developers. No joke. It's probably the most taught language for a decade.

It still isn't hip or sexy though, so people will ask if its dying or dead. ;D.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Mark Oates
Member #1,146
March 2001
avatar

It's interesting that C and C++ are polled separately. I guess it makes sense, you could probably find wider differences between those than with some other language.

--
Visit CLUBCATT.com for cat shirts, cat mugs, puzzles, art and more <-- coupon code ALLEGRO4LIFE at checkout and get $3 off any order of 3 or more items!

AllegroFlareAllegroFlare DocsAllegroFlare GitHub

Peter Hull
Member #1,136
March 2001

It still isn't hip or sexy though,

It was hip and sexy in, lets say, the late 90s/early 2000s. A lot of column inches were written about the Java revolution.

I guess it was Ruby/RoR that opened people's eyes to a more agile, rapid style of programming for the web, and Java began to look cumbersome in comparison. But for larger projects I think its 'engineering' side becomes valuable.

I wonder what would have happened if Sun had been able to get applets working really well (or at least as well as Flash) - they were always really clunky due to the implementation and I think that caused a lot of the 'Java is slow' thing that still hangs over it.

Anyway, once a thing gets a certain amount of momentum, it's hard to displace (COBOL hasn't been hip for 40years and there's still allegedly a lot of it still about.) Maybe Java (or something else on the JVM) will rise again! :o

Thomas Fjellstrom
Member #476
June 2000
avatar

It was hip and sexy in, lets say, the late 90s/early 2000s. A lot of column inches were written about the Java revolution.

Yup. Thats why it is/was taught a lot, and is used to much. It was the new cool, so everyone wanted to use it.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730



Go to: