A fundamental turn toward concurrency in software

Started by
9 comments, last by aboeing 19 years, 3 months ago
http://www.gotw.ca/publications/concurrency-ddj.htm He makes a good point, but I fear for recklessly using threads in the name of performance because they make it amazingly simple to blow your entire leg off. What sort of alternatives are there to lock-based concurrency?
--God has paid us the intolerable compliment of loving us, in the deepest, most tragic, most inexorable sense.- C.S. Lewis
Advertisement
Message queues
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Quote:Message queues

Thats what I was thinking of when I read this post a few minutes ago.

However, I dismissed it as an alternative because (iirc) you can still require locks on shared resources.

Message queues can allow execution on private (or non-shared) data in parallel, but if two threads want to query or work on the same resource.

Say something triggers a message about a new object in a 3D world, its sent to both physics-thread and graphics-thread. Both will probably want to read the data, but the physics-thread may want to change the object - you'll get some potentially nasty outcomes if you allow the graphics-thread to blindly read through the data if the physics-thread is also going through and changing stuff.

I'm ready to be proven wrong on this though [smile]
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

Quote:From the article antareus linked
3. Efficiency and performance optimization will get more, not less, important. Those languages that already lend themselves to heavy optimization will find new life; those that don’t will need to find ways to compete and become more efficient and optimizable. Expect long-term increased demand for performance-oriented languages and systems.


Which languages are these? C/C++ already seem to lend themselves to ridiculous levels of optimization by comparison to the VM based languages - is that all he means?

Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

Referentially transparent languages (ala Haskell), can theoretically be made concurrent transparently (i.e. without any special constructs). I think the keyword is Declarative Concurrency.
---New infokeeps brain running;must gas up!
Quote:Original post by antareus
What sort of alternatives are there to lock-based concurrency?


Lock-free data structures.

MSN
Automatic Parallelization
The free lunch continues...
Their graph is stupid. Their 'trend line' has nothing to do with the actual data they display. I could draw a line on that graph 'proving' that clock speeds will triple in the next ten minutes... or that they will decrease steadily from now on. They exaggerate the slope of the clock-speed line in order to give themselves some altitude, and then flatline it at the point where they run out of hard data.

*waves at aboeing*
Two posts in one day? Did you just get back from somewhere? :)
Quote:Original post by fractoid
Their graph is stupid. Their 'trend line' has nothing to do with the actual data they display


I didn't think it was so bad. Sure, statistics can often be bent to mean whatever you want them to mean. Based on the intel data they've used, the trend line seems to follow and the clock speeds do seem to have noticeably slowed their increase recently.

I'm still laughing that I forked out the extra cash a year ago for a fast CPU and it hasn't been completely overshadowed yet.. [smile]

Quote:Original post by aboeing
Automatic Parallelization
The free lunch continues...

Yeah, wouldn't be surprised if such a thing appears as part of languages, operating systems or just add-in libraries etc...

However, that probably won't work for the really performance-critical software (not just games). I'd imagine that we'll still have to resort to design-level consideration of concurrency in our applications in order to levy the power of a Pentium-5 [smile]

Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

Something that might be of interest to those reading this thread that haven't seen it before...

5 GHz Project: CPU Cooling With Liquid Nitrogen and the associated video can be downloaded here. Worth downloading/watching if you've got the time...

Granted, you aren't likely to see that sort of technology in the local PC superstore, but it is sort of "proof" that faster CPU's are stable and possible in the commercial world [smile]

Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

This topic is closed to new replies.

Advertisement