Don't Understand wait() and notify()

B

blmblm

On Mar 28, 10:35 pm, (e-mail address removed) <[email protected]>
wrote:

[ snip ]
Whoops. My mistake. I saw that after I posted to the code here.
Thanks for the reminder, though.

Sure. It's a common newbie mistake, and I wasn't sure from your
post that you knew / remembered the right way.

By the way, your post as it showed up in my newsreader contained
the full text of the post to which you were replying, *plus* the
"Probably gotcha" lines included above. It doesn't seem like that
could have been intentional. Thinko, or glitch in whatever you
use to post?
 
J

Jason Cavett

Jason Cavett said:
On Mar 28, 10:35 pm, (e-mail address removed) <[email protected]>
wrote:

[ snip ]
Whoops. My mistake. I saw that after I posted to the code here.
Thanks for the reminder, though.

Sure. It's a common newbie mistake, and I wasn't sure from your
post that you knew / remembered the right way.

By the way, your post as it showed up in my newsreader contained
the full text of the post to which you were replying, *plus* the
"Probably gotcha" lines included above. It doesn't seem like that
could have been intentional. Thinko, or glitch in whatever you
use to post?

Really? Weird. I wonder if that's because I had that part
highlighted when I hit "Reply." I'll have to look into that. Thanks.
 
L

Lew

Patricia said:
A few years ago someone who divided computing into "elite" and
"non-elite" might have classed parallelizing compute bound work as an
"elite" technique, because, of course, no computer one should talk about
in public fora could possibly really run more than one thread at a time.

My working assumption is that there are three possible states for an
"elite" computer performance idea: it is already on desktops, or it is
coming soon to a desktop near you, or it has been superseded by better
ideas.

Indeed, "X2" multi-core processors are The Thing now at very reasonable
prices, and SMP versions of Windows and Linux are commonly available.

Late model Intel chips also have that lovely "hyper-threading" that lets one
take advantage of SMP as well.

-- Lew
 
S

SadRed

Real computers have been able to do that since the early 60s.


So much for nearly half a century of computer science and
operating-system design.

There's more to the world than bog-standard personal computers, you
know, and there's more to performance optimization than your offhand
guesses.

--
John W. Kennedy
"Sweet, was Christ crucified to create this chat?"
-- Charles Williams. "Judgement at Chelmsford"
* TagZilla 0.066 *http://tagzilla.mozdev.org

As my last post on this thread I'd like to restate that unless you
have a combination of very special hardwares and a very special
operating system, you can't get a real parallelism from your disk-
based file system. Period.
 
T

Tom Hawtin

Seems to me that maybe the important thing is whether you want to
always perform the notify(), even if there are exceptions or errors,
or sometimes perform it and sometimes not, and that putting it first
would be appropriate for the first case but not for the second. Or
am I missing the point you're making?

Why would you not want to perform a notify?

If there is any chance that something is updated that needs a notify,
then you should notify. Given that you can't (technically) guarantee to
notify after the update, doing it before isn't a bad idea (other than
causing other programmers to scratch their head).

Tom Hawtin
 
L

Lew

SadRed said:
As my last post on this thread I'd like to restate that unless you
have a combination of very special hardwares and a very special
operating system, you can't get a real parallelism from your disk-
based file system. Period.

One doesn't necessarily need "true parallelism" to benefit from things like
elevator-seeking algorithms, which can benefit from thread parallelism.

All you need are IDE hard drives - one can issue parallel operations to disks
on the primary and secondary IDE ports - and a consumer OS like MS Windows or
Linux, which have been doing so for quite awhile.

Just to pick one example of the sort of combination of very special hardware
and a very special operating system that one might encounter in the wild.

-- Lew
 
B

blmblm

Why would you not want to perform a notify?

If there is any chance that something is updated that needs a notify,
then you should notify. Given that you can't (technically) guarantee to
notify after the update, doing it before isn't a bad idea (other than
causing other programmers to scratch their head).

Ohhhh .... Right. Because the thing being notified is supposed to
check, after being waked up, whether the condition it was waiting
for is actually true.

So there's no harm in doing an extra notify, aside from a small
possible loss of efficiency.

"What was I thinking?" ?
 
M

Martin Gerner

I'm afraid you are right that I don't understand the idea of
separating computing into "elite" and "non-elite" categories, with
only the "non-elite" considered fit for discussion in public fora.

Out of order execution was one of the special features of the CDC
6600, presumably "elite". These days, it is normal in desktop
processors.

RAID was originally a way of applying to servers the price/capacity of
mass produced disk drives, but the last time I saw a terabyte scale
RAID-5 disk array it was on the external disk drive shelf at a local
home electronics store.

A few years ago someone who divided computing into "elite" and
"non-elite" might have classed parallelizing compute bound work as an
"elite" technique, because, of course, no computer one should talk
about in public fora could possibly really run more than one thread at
a time.

My working assumption is that there are three possible states for an
"elite" computer performance idea: it is already on desktops, or it is
coming soon to a desktop near you, or it has been superseded by better
ideas.

Patricia

Sorry about the spam, but I just have to say that I really loved this
post of yours :)

Haven't been smiling so much for a while, I believe.

Thanks for all the great posts and advice you give to this group!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,188
Latest member
Crypto TaxSoftware

Latest Threads

Top