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
Gideon Weems
Member #3,925
October 2003

jmasterx said:

For those who saw it already:

I might add:

free(h); // Because h = 0 leads to an interpreter error.
f += r;
atexit(ls);

Bruce Perry
Member #270
April 2000

That fills me with joy. Someone sigged me once for saying that most of the arguments I'd seen against global variables seemed to be religious :)

Now, that said, I have the opposite problem. I'm having to work in C++ a bit, and I missed nested methods the other day. So, how did I solve it? I now have four copies of that code, and I condensed each copy into a single line to keep it 'manageable' :P

--
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.

Chris Katko
Member #1,881
January 2002
avatar

C++ a bit, and I missed nested method.

I'm so pissed off at the basic, great features C++ can't be bothered to add. Plenty of them can be nothing more than syntactic sugar and have no real impact on the assembly generated.

-----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

jmasterx
Member #11,410
October 2009

I'm so pissed off at the basic, great features C++ can't be bothered to add. Plenty of them can be nothing more than syntactic sugar and have no real impact on the assembly generated.

C++ is supposed to be difficult to learn and use... that's a core part of the language. You have to feel like you're working really hard and need to write huge amounts of boilerplate code to feel that C++ satisfaction!

amarillion
Member #940
January 2001
avatar

So does this thread now prove that threads actually don't lock too soon? I'm confused?!?!

jmasterx
Member #11,410
October 2009

No, if they did not lock too soon we wouldn't have to create this spam-fest to keep it alive >:(

Point being - Threads have to be kept alive with spam... otherwise, people could just reply when there is something meaningful to say...

Moreover, threads that get locked too soon often cause new child threads to spawn under the same topic because there are too few users on the forum anymore and often 5 days is not enough time for someone to answer a programming or other question...

We're revolting! Vive la revolution! >:(

bamccaig
Member #7,536
July 2006
avatar

jmasterx said:

My New Years Resolution ... will ofcourse be 4K.... but I also plan to use a lot more Global Variables and Global State in my code. Despite what Bambam has lectured about Globals, they are actually incredibly great and lead to less refactoring in the long run and an overall simpler and cleaner codebase.

In fact, had ML used a global $threadTimeout, we would not have needed this thread!
>:(

That fills me with joy. Someone sigged me once for saying that most of the arguments I'd seen against global variables seemed to be religious :)

{"name":"db0629a737a0aa046b8e3c804481c554f69a1a07014dc48c4e74516dd838fae4.jpg","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/5\/4512372e324399b10059aac9e7b1e129.jpg","w":600,"h":336,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/4\/5\/4512372e324399b10059aac9e7b1e129"}db0629a737a0aa046b8e3c804481c554f69a1a07014dc48c4e74516dd838fae4.jpg

Mark Oates
Member #1,146
March 2001
avatar

Arguments about globals are religious bam, you suck!

Also, we have already established that despite ML's exemplary use of object inheritance, he has also seen the way and has released his burden of the spaghetti to the way of the global.

--
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

I'm having to work in C++ a bit, and I missed nested methods the other day.

What are you using that does have nested methods? I thought you were a Java person.

These days I think you can use C++11 lambdas to get the effect of nested methods, can't you?

Pete

bamccaig
Member #7,536
July 2006
avatar

{"name":"your-argument-is-invalid-false-my-argument-makes-perfect-sense-and-youre-a-vagina.png","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/0\/8\/08450a65eb234d54a233d85e93af52f9.png","w":551,"h":380,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/0\/8\/08450a65eb234d54a233d85e93af52f9"}your-argument-is-invalid-false-my-argument-makes-perfect-sense-and-youre-a-vagina.png

Bruce Perry
Member #270
April 2000

What are you using that does have nested methods? I thought you were a Java person.

D :)

Lately I've been mostly C#, since we're working with Unity. It's probably at least two years since I really did any Java (except for finishing Confined off).

And no, C# doesn't have nested methods either. Perhaps I feel more comfortable finding ways around it by making classes in C# because there's less boilerplate involved...

Quote:

These days I think you can use C++11 lambdas to get the effect of nested methods, can't you?

You can. I wonder how well or badly it optimises... (Last thing you want is a function pointer call when a normal function call would have sufficed.)

--
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.

Chris Katko
Member #1,881
January 2002
avatar

These days I think you can use C++11 lambdas to get the effect of nested methods, can't you?

The issues there are because they're designed to solve another problem so:

1 - Possible speed issues, as was brought up.

2 - Restriction issues. A lambda can be passed around. A nested function is supposed to never leave.

-----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

Gideon Weems
Member #3,925
October 2003

Pop quiz, hot shot! Without looking, which thread has a higher word count? This one or the Zelda/feminism thread?

  This thread:  1618
Zelda debacle:  4155

Bruce Pascoe
Member #15,931
April 2015
avatar

Admittedly though, the Zelda thread seems to be generating far more heat than light.

Erin Maus
Member #7,537
July 2006
avatar

Pop quiz, hot shot! Without looking, which thread has a higher word count? This one or the Zelda/feminism thread?

Well, that puts it in perspective. You know, I write something and then add some more, stream-of-consciousness-like. Reword, rephrase, restructure... And then I realize I worded something wrong, or something is too vague, so I elaborate a bit more. Repeat that more times than I care to count... And when I proof it, I realize I just wasted up to half an hour (or more, who knows) writing the post. So simply not posting means the half an hour was completely wasted. But while posting means I did something, I also am adding to a pointless conversation... and oh no, it's happening again!

---
ItsyRealm, a quirky 2D/3D RPG where you fight, skill, and explore in a medieval world with horrors unimaginable.
they / she

Gideon Weems
Member #3,925
October 2003

Well, that puts it in perspective.

I thought so, too. I also think that it is unfair (perhaps even unreasonable) to write off recent forum activity as low volume. Rather, with longer, more thought-out (sometimes) posts, we are in a golden age of volume.

And I will always be there with one-line zingers when you need them.

Thomas Fjellstrom
Member #476
June 2000
avatar

Almost to new years, It's already 2016 in the Philippines. I'm celebrating with my wife right now!

--
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

jmasterx
Member #11,410
October 2009

ps. I can't see this thread staggering on into 2016, can you?

>:(

Peter Hull
Member #1,136
March 2001

@jmasterx : I'm basing my assertions on GMT. This may be the last post.

jmasterx
Member #11,410
October 2009

Looks like this thread has broken a.cc
{"name":"609983","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/7\/0\/70dad377a667765e77c7240121a5ba7a.png","w":1875,"h":98,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/7\/0\/70dad377a667765e77c7240121a5ba7a"}609983
Page 1? Where are you!?

That or M.L broke the site trying to delete this thread ::)

Mark Oates
Member #1,146
March 2001
avatar

I get 4 pages
{"name":"609984","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/6\/9\/699908574e3852d7ea5c3fa7bdbc89d5.png","w":1253,"h":479,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/6\/9\/699908574e3852d7ea5c3fa7bdbc89d5"}609984

but I view 50 replies per page
{"name":"609985","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/7\/5\/756908469f2e5adf4d734271c12f0f15.png","w":767,"h":585,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/7\/5\/756908469f2e5adf4d734271c12f0f15"}609985

--
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

Bruce Pascoe
Member #15,931
April 2015
avatar

He's right, there's literally no Page 1. I figured it was just cutting off the earlier pages due to being so far in (like most forums do), but even go to page 2 and there's still no option to select page 1.

bamccaig
Member #7,536
July 2006
avatar

I view unlimited posts per page like a boss. Who has time or patience for replying to multiple pages when your machine has billions and billions of bytes of working memory? >:(

Mark Oates
Member #1,146
March 2001
avatar

Ok, so I was trolling online to look for a gif of a person scrolling a mouse over and over...

...but then I found this actual picture of Thomas Fjellstrom in the Philippines right now:
{"name":"609986","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/6\/7\/67c7cbd5b1b871c5cb7051e5fb678e28.gif","w":385,"h":400,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/6\/7\/67c7cbd5b1b871c5cb7051e5fb678e28"}609986

;D;D;D

so yea, that was way better. ;D

--
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

bamccaig
Member #7,536
July 2006
avatar



Go to: