Click here to Skip to main content
15,894,955 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: I fear and loathe writing multithreaded code Pin
#realJSOP21-Mar-20 2:15
mve#realJSOP21-Mar-20 2:15 
GeneralRe: I fear and loathe writing multithreaded code Pin
honey the codewitch21-Mar-20 2:32
mvahoney the codewitch21-Mar-20 2:32 
GeneralRe: I fear and loathe writing multithreaded code Pin
Greg Utas21-Mar-20 2:46
professionalGreg Utas21-Mar-20 2:46 
GeneralRe: I fear and loathe writing multithreaded code Pin
honey the codewitch21-Mar-20 2:55
mvahoney the codewitch21-Mar-20 2:55 
GeneralRe: I fear and loathe writing multithreaded code Pin
Greg Utas21-Mar-20 3:13
professionalGreg Utas21-Mar-20 3:13 
GeneralRe: I fear and loathe writing multithreaded code Pin
Jörgen Andersson21-Mar-20 6:53
professionalJörgen Andersson21-Mar-20 6:53 
GeneralRe: I fear and loathe writing multithreaded code Pin
Greg Utas21-Mar-20 7:12
professionalGreg Utas21-Mar-20 7:12 
GeneralRe: I fear and loathe writing multithreaded code Pin
kalberts21-Mar-20 12:04
kalberts21-Mar-20 12:04 
A comment, and a good/sad memory, related to your P/V discussion:

As a unversity freshman, I picked up Brinch Hansen's "Operating System Principles", and were truly fascinated by the analysis of concurrency and use of P/V to protect shared resources; I think I could recite chapters of the book by heart Smile | :) . During my sophomore year, "The Architecture of Concurrent Programs" arrived in the university bookstore, and we were a big gang of students rushing to buy it, to read more fascinating discussions of concurrency problems, and the careful programming required to handle them.

The second book was sort of a downturn. All problems were solved, there were none left. Built on top of P/V were critical regions, monitors, and queue mechanisms that made concurrent programming safe and simple! (At least compared to the P/V level!) The job was done. No more problems to be solved. At least that is how it felt at the moment.

This was in the pre-*nix days, or rather: *nix had not yet run down all other OS ideas and discussions, but it was about to. So while we were expecting monitors and critical regions to become The Standard, we rather were told that "There is but one process in an address space, and there is but one address space per process!" That adress space were closed, statically determined. Coming from other worlds where activities/threads and address spaces were more or less separate, independent concepts, we shook our heads. But for many years, we had to struggle with the existence of a file as one - in our eyes completely crazy - implementation of a (binary, queueless!) P/V semaphore. There simply was no room for what we had learned about regions and monitors and queues.

We had one relief: The CHILL programming language (Z.200, 1980) provided regions, nonitors and queues as first-class language elements. As was process concept - we would call it threads today, because they were (very) lightweight and were independent of address space concepts. But CHILL never made it outside the telecom world (the reason why we were involved was that our university had been involved in the definition and implementation).

Even today, there are very few signs of "The Revenge of the Monitor". Or critical region. Still, a lot of *nix based subsystems indicate that concurrency protection is "optional", and my impression is that even when data structures are protected, in most cass it is by an onion skin wrapper on top of P/V. High level constructs are essentially unsupported by most languages and unknown to most programmers. Obviously we can dig up Brinch-Hansen's book (or any other from the same period that discusses it), and hand-craft the high-level mechanisms, but few do. Few know how to do it.

The solutions are there. That's the good thing. Very few use them. That's the sad thing.

(For those who have noticed another post of mine, where I am arguing for autonomous objects communicating through messages: Such an object strongly resembles the original, single-thread, isolated *nix process, doesn't it? Yes in many ways it does. But it wasn't used that way. A process was not considered as an object instance, cooperating with other objects in a composite application solution the way we use OO today. *nix processes were generally not written as message driven state machines. The basic thinking was based on sequential code.)
GeneralRe: I fear and loathe writing multithreaded code Pin
Greg Utas21-Mar-20 13:12
professionalGreg Utas21-Mar-20 13:12 
GeneralRe: I fear and loathe writing multithreaded code Pin
Rick York21-Mar-20 8:06
mveRick York21-Mar-20 8:06 
GeneralRe: I fear and loathe writing multithreaded code Pin
kalberts21-Mar-20 9:39
kalberts21-Mar-20 9:39 
GeneralRe: I fear and loathe writing multithreaded code Pin
honey the codewitch21-Mar-20 10:34
mvahoney the codewitch21-Mar-20 10:34 
GeneralRe: I fear and loathe writing multithreaded code Pin
honey the codewitch21-Mar-20 10:38
mvahoney the codewitch21-Mar-20 10:38 
GeneralRe: I fear and loathe writing multithreaded code Pin
harold aptroot21-Mar-20 22:50
harold aptroot21-Mar-20 22:50 
GeneralRe: I fear and loathe writing multithreaded code Pin
honey the codewitch22-Mar-20 4:07
mvahoney the codewitch22-Mar-20 4:07 
GeneralI suddenly got back into Espresso again. Pin
OriginalGriff21-Mar-20 0:46
mveOriginalGriff21-Mar-20 0:46 
GeneralRe: I suddenly got back into Espresso again. Pin
lopatir21-Mar-20 0:49
lopatir21-Mar-20 0:49 
GeneralRe: I suddenly got back into Espresso again. Pin
glennPattonWork321-Mar-20 0:50
professionalglennPattonWork321-Mar-20 0:50 
GeneralRe: I suddenly got back into Espresso again. Pin
OriginalGriff21-Mar-20 0:54
mveOriginalGriff21-Mar-20 0:54 
GeneralRe: I suddenly got back into Espresso again. Pin
glennPattonWork321-Mar-20 0:56
professionalglennPattonWork321-Mar-20 0:56 
GeneralRe: I suddenly got back into Espresso again. Pin
honey the codewitch21-Mar-20 1:44
mvahoney the codewitch21-Mar-20 1:44 
GeneralRe: I suddenly got back into Espresso again. Pin
DRHuff21-Mar-20 7:05
DRHuff21-Mar-20 7:05 
GeneralTrouble with Teams... Pin
glennPattonWork321-Mar-20 0:34
professionalglennPattonWork321-Mar-20 0:34 
GeneralRe: Trouble with Teams... Pin
lopatir21-Mar-20 0:47
lopatir21-Mar-20 0:47 
GeneralRe: Trouble with Teams... Pin
glennPattonWork321-Mar-20 0:49
professionalglennPattonWork321-Mar-20 0:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.