Thread synchronization

T

Thomas G. Marshall

Mike Schilling coughed up:
"Thomas G. Marshall"


This is presumably the type returned by
Collections.synchronizedCollection() ? How would you want to use it
other than by calling that method?

/I/ wouldn't. This discussion is about how xarax is advocating the
extension of ArrayList into something more dedicated for synchronization
reasons of his (walk up this thread a couple of posts or so), to avoid
having to externally synchronize on the class itself.

He would be aided by being able to extend a synchronized collection class.
The problem is that you can get a synchronized collection at runtime, but
they do not seem to allow you to grab one at compile time because the class
is package scope. I find that limitation a /tad/ curious.
 
T

Thomas G. Marshall

Thomas G. Marshall coughed up:
Mike Schilling coughed up:

/I/ wouldn't. This discussion is about how xarax is advocating the
extension of ArrayList into something more dedicated for
synchronization reasons of his (walk up this thread a couple of posts
or so), to avoid having to externally synchronize on the class
object


itself.

He would be aided by being able to extend a synchronized collection
class. The problem is that you can get a synchronized collection at
runtime, but they do not seem to allow you to grab one at compile
time because the class is package scope. I find that limitation a
/tad/ curious.
 
M

Mike Schilling

Thomas G. Marshall said:
He would be aided by being able to extend a synchronized collection class.
The problem is that you can get a synchronized collection at runtime, but
they do not seem to allow you to grab one at compile time because the
class
is package scope. I find that limitation a /tad/ curious.

The class is just a wrapper, though. It provides synchronization, but
relies on the wrapped object to implement all of the Collection semantics.
Are you wondering why it wasn't implemented as an accessible class like the
IO filters, e.g.

public SynchronizedCollection implements Collection
{
public SynchronizedCollection(Collection wrapped)
{
...
}
}

I don't know the answer, but I can't see what different it makes to the
synchronizedCollection() user.
 
T

Thomas G. Marshall

Mike Schilling coughed up:
"Thomas G. Marshall"


The class is just a wrapper, though. It provides synchronization, but
relies on the wrapped object to implement all of the Collection
semantics. Are you wondering why it wasn't implemented as an
accessible class like the IO filters, e.g.

The decorator pattern that java.io uses? No.

public SynchronizedCollection implements Collection
{
public SynchronizedCollection(Collection wrapped)
{
...
}
}

I don't know the answer, but I can't see what different it makes to
the synchronizedCollection() user.

The class Collections.SynchronizedCollection would have been useful for
xarax to extend, given his suggested class design.

Without having such a class to extend, and if you're intent upon creating
something that extends the a collection /and/ be synchronized, you're left
with creating a class that extends the non-synchronized collection, and
hand-implementing a wrapper for each and every method.
 
L

Lee Fesperman

[ Rant Snipped ]

Yeah, right. You want to invent your own terminology and concepts and then argue
vehemently (against all comers) that we must accept it on your terms. You're doing this
on other threads as well.

What bothers me is that you're teaching your poorly formed ideas to others.
 
T

Thomas G. Marshall

Lee Fesperman coughed up:
[ Rant Snipped ]

Yeah, right. You want to invent your own terminology and concepts and
then argue vehemently (against all comers) that we must accept it on
your terms. You're doing this on other threads as well.

....[rip]...


Funny how you didn't answer the points in my post. I've shown you to be
incorrect, and shown you to be dishonestly representing quotes.

No wonder you say "yeah right", and snip it all away.

You were the first to use insulting terminology, and now that you've shown
to be a fool, you cannot stand it.
 
L

Lee Fesperman

Thomas said:
Lee Fesperman coughed up:
[ Rant Snipped ]

Yeah, right. You want to invent your own terminology and concepts and
then argue vehemently (against all comers) that we must accept it on
your terms. You're doing this on other threads as well.

...[rip]...

Funny how you didn't answer the points in my post. I've shown you to be
incorrect, and shown you to be dishonestly representing quotes.

No wonder you say "yeah right", and snip it all away.

It's ironic that you demand responses since you've consistently refused to speak to my
previous on-topic replies, being content to just parody my words.

Anyway, your point was that it is eminently reasonable to invent new terminology even
though good terminology already exists in common usage. That is simply a bad idea, and I
spoke to that point.

Note: If you are searching for a phrase that includes both blocks and methods, try:
"synchronized method/block". It even uses the common keyword.

Back on topic... Another of your inventions is the concept:

"[Synchronization is for] protecting code from concurrent execution."

That is ill-formed, incomplete. Synchronization is for protecting shared 'state' from
concurrent access/change. You have not established a single counter argument to that
assertion.

BTW, are you aware that synchronization implementation in the JVM involves erecting
memory barriers? Why do you think that is true?
You were the first to use insulting terminology, and now that you've shown
to be a fool, you cannot stand it.

I made disparaging comments about your words (not about you!) after you began ridiculing
mine, indulging in ad hominem. We shall see whose ideas are foolish.
 
T

Thomas G. Marshall

Lee Fesperman coughed up:

....[rip]...

Ok, enough. My turn to snip it all away.

Lee, I'm going to assume that you're a bright guy. I'm also going to assume
that you're not a bad guy, and that we just somehow got off on the wrong
foot.

That being said, I'm as tired of this as you probably are. So I'm done
here.

And I wish you well.
 
L

Lee Fesperman

Thomas said:
Lee Fesperman coughed up:

...[rip]...

Ok, enough. My turn to snip it all away.

Lee, I'm going to assume that you're a bright guy. I'm also going to assume
that you're not a bad guy, and that we just somehow got off on the wrong
foot.

I'm not sure about being bright, but I do have experience in this area. I've implemented
3 different operating systems, each with external synchronization primitives plus
internal synchronization schemes. I do have a clue that synchronization is about shared
state.
That being said, I'm as tired of this as you probably are. So I'm done
here.

I'm certainly tired of the lack of substantive discussion.
And I wish you well.

Likewise. As I said, none was intended to be ad hominem. A good example of ad hominem
would be the blast that Roedy gave me on c.l.j.d.. He even cast aspersions on my
parenting skills ;^)
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top