Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > events and threads

Reply
Thread Tools

events and threads

 
 
farseer
Guest
Posts: n/a
 
      04-08-2005
Hello,
i'd like to do the following. I have two classes that implement
Runnable, ThreadA and ThreadB. There may be many ThreadA instances,
but only one ThreadB instance. ThreadB will "fire" various events and
The ThreadA instance will listen for these events.

My questions are:
1) is this possible
2) How do i do this?
i know the following. I create an EventListener in ThreadA and it's
actionPerformed method will just add the Events to an ArrayList (i am
not worried about synchronization, since only the instance of ThreadA
will be modifying that ArrayList). The run method of ThreadA will
process the queue (ArrayList) as long as it's not empty.
THAT SAID, i am not sure how to register an event in this case? or do i
need to do that? If i fire an event from ThreadB, will any class that
has a listener method for that event be able to "catch" that event?

i guess i need some help in figuring out how to implement this
scenario, in particular, how to register the EventListener and whether
this will create problems since it's two threads..one firing the events
and one listening for the events?

thanks much.

 
Reply With Quote
 
 
 
 
John McGrath
Guest
Posts: n/a
 
      04-08-2005
On 4/7/2005 at 11:59:09 PM, farseer wrote:

> i'd like to do the following. I have two classes that implement
> Runnable, ThreadA and ThreadB. ....


I already answered his question in the comp.lang.java.help newsgroup.
Multiposting is generally frowned on, so please do not do it. Thanks.

--
Regards,

John McGrath
 
Reply With Quote
 
 
 
 
farseer
Guest
Posts: n/a
 
      04-08-2005
what is the more active java groups?

 
Reply With Quote
 
Matt Humphrey
Guest
Posts: n/a
 
      04-08-2005

"farseer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> what is the more active java groups?
>


Both are active. .help is more for beginners and .programmer is more for
advanced topics.

Cheers,
Matt Humphrey http://www.velocityreviews.com/forums/(E-Mail Removed) http://www.iviz.com/



 
Reply With Quote
 
Thomas G. Marshall
Guest
Posts: n/a
 
      04-08-2005
Matt Humphrey coughed up:
> "farseer" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) oups.com...
>> what is the more active java groups?
>>

>
> Both are active. .help is more for beginners and .programmer is more
> for advanced topics.
>
> Cheers,
> Matt Humphrey (E-Mail Removed) http://www.iviz.com/



This is how it seems to be accepted, which is fine, but I don't mind if
people don't realize this. After all, the published "official" big-8
newsgroup list does not say this in the group description at all.

The description for comp.lang.java.help is:

"Set-up problems, catch-all first aid."

It does *not* say (perhaps it should, perhaps not):

"Set-up problems, beginner questions"

Here are the java groups with descriptions, as posted monthly in
news.announce.newgroups, under the subject "List of Big Eight Newsgroups":

http://groups-beta.google.com/group/...dfac4b68b6de8c


comp.lang.java.3d 3D Graphics API's for the Java language.
comp.lang.java.advocacy Support for and criticism of the Java System.
comp.lang.java.announce Announcements re the Java System. (Moderated)
comp.lang.java.beans Java software components (JavaBeans).
comp.lang.java.corba Topics relating to Java and CORBA.
comp.lang.java.databases Databases, java.sql, JDBC, ODBC.
comp.lang.java.gui GUI toolkits and windowing: AWT, IFC etc.
*comp.lang.java.help* Set-up problems, catch-all first aid.
comp.lang.java.machine JVM, native methods, hardware.
comp.lang.java.programmer Programming in the Java language.
comp.lang.java.security Security issues raised by Java.
comp.lang.java.softwaretools IDEs, browsers, compilers, other tools.

Note the mispelling of "JFC" in c.l.j.gui

--
Unix users who vehemently argue that the "ln" command has its arguments
reversed do not understand much about the design of the utilities. "ln
arg1 arg2" sets the arguments in the same order as "mv arg1 arg2".
Existing file argument to non-existing argument. And in fact, mv
itself is implemented as a link followed by an unlink.


 
Reply With Quote
 
Chris Smith
Guest
Posts: n/a
 
      04-09-2005
Thomas G. Marshall wrote:
> This is how it seems to be accepted, which is fine, but I don't mind if
> people don't realize this. After all, the published "official" big-8
> newsgroup list does not say this in the group description at all.


Indeed. If you carefully read the charters, you'll notice that .help is
supposedly only vaguely appropriate for programming questions, and
mainly for setup/installation problems. The main problem here is that
charters can not be changed, so we're stuck with what Peter van der
Linden came up with back in 1997. (This also explains clj.gui's
inclusion of IFC, but not the newer JFC.)

Two conclusions:

1. Usage needs to be defined by group concensus, not by the charter or
description of the groups when they were created.

2. Because no one has authority on the usage of the groups, being a
netcop on topicality between the groups just makes one look silly.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
Reply With Quote
 
Thomas G. Marshall
Guest
Posts: n/a
 
      04-09-2005
Chris Smith coughed up:
> Thomas G. Marshall wrote:
>> This is how it seems to be accepted, which is fine, but I don't mind
>> if people don't realize this. After all, the published "official"
>> big-8 newsgroup list does not say this in the group description at
>> all.

>
> Indeed. If you carefully read the charters, you'll notice that .help
> is supposedly only vaguely appropriate for programming questions, and
> mainly for setup/installation problems. The main problem here is that
> charters can not be changed, so we're stuck with what Peter van der
> Linden came up with back in 1997. (This also explains clj.gui's
> inclusion of IFC, but not the newer JFC.)
>
> Two conclusions:
>
> 1. Usage needs to be defined by group concensus, not by the charter or
> description of the groups when they were created.


Almost. Believe me, I'm not one of the usenet nazi's. But the charter as
applicable to group descriptions /is/ done by vote, which is a consensus of
sorts. The problem with having it be common usage dictated is the
following:

1. people continually educate others (often way too emphatically) about
reading the charters and reading descriptions to find the right group for
their posts.

2. the same people who holler at people for posting in the wrong place
are the same /types/ of people that holler at people for not posting
beginner quotes into .help.

In other words, if there is a description, it really oughtta be "right".
How "right" is determined, be it common usage or pretended fiat, is not my
concern.


> 2. Because no one has authority on the usage of the groups, being a
> netcop on topicality between the groups just makes one look silly.


I agree. (I hope you weren't fingering me in that). The problem is that
there isn't the following, which is desperately needed:

comp.lang.java.beginner

I've promised to myself to go through the hoopla of requesting that group,
but have since found a million other things to do.

The other *HUGE* problem, IMO, is that the retired newsgroups are not
retired in most places. There really should be monthly postings in
comp.lang.java for example:

Subject: This newsgroup has been retired.

<content>
The official ng's are now. Please don't post in comp.lang.java, but find a
suitable alternative:

comp.lang.java.3d 3D Graphics API's for the Java language.
comp.lang.java.advocacy Support for and criticism of the Java System.
(etc.)
</content>

What makes this a huge problem IMO is that retired ng's tend to suck the
life out of non-retired groups by placing posts into a void where many of
the folks that know better do not venture.


--
Everythinginlifeisrealative.Apingpongballseemssmal luntilsomeoneramsitupyournose.


 
Reply With Quote
 
Lee Fesperman
Guest
Posts: n/a
 
      04-09-2005
Thomas G. Marshall wrote:
> The other *HUGE* problem, IMO, is that the retired newsgroups are not
> retired in most places. There really should be monthly postings in
> comp.lang.java for example:
>
> Subject: This newsgroup has been retired.
>
> <content>
> ...


Are you volunteering? You did say it was a *HUGE* (double emphasis) problem ;^)

You know: everyone complains about the weather, but nobody does anything about it.

--
Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com)
================================================== ============
* The Ultimate DBMS is here!
* FirstSQL/J Object/Relational DBMS (http://www.firstsql.com)
 
Reply With Quote
 
Thomas G. Marshall
Guest
Posts: n/a
 
      04-09-2005
Lee Fesperman coughed up:
> Thomas G. Marshall wrote:
>> The other *HUGE* problem, IMO, is that the retired newsgroups are not
>> retired in most places. There really should be monthly postings in
>> comp.lang.java for example:
>>
>> Subject: This newsgroup has been retired.
>>
>> <content>
>> ...

>
> Are you volunteering? You did say it was a *HUGE* (double emphasis)
> problem ;^)
>
> You know: everyone complains about the weather, but nobody does
> anything about it.



Such postings should really be automated, and automated postings are
suitable fodder for abuse complaints out the wazoo.

If you think it'd help, I'll be glad to post something like that once in a
while. Do you think it would be well received? Or would I condemned as a
self appointed ruler...



--
If I can ever figure out how, I hope that someday I'll
succeed in my lifetime goal of creating a signature
that ends with the word "blarphoogy".


 
Reply With Quote
 
Lee Fesperman
Guest
Posts: n/a
 
      04-09-2005
Thomas G. Marshall wrote:
>
> Lee Fesperman coughed up:
> > Thomas G. Marshall wrote:
> >> The other *HUGE* problem, IMO, is that the retired newsgroups are not
> >> retired in most places. There really should be monthly postings in
> >> comp.lang.java for example:
> >>
> >> Subject: This newsgroup has been retired.
> >>
> >> <content>
> >> ...

> >
> > Are you volunteering? You did say it was a *HUGE* (double emphasis)
> > problem ;^)
> >
> > You know: everyone complains about the weather, but nobody does
> > anything about it.

>
> Such postings should really be automated, and automated postings are
> suitable fodder for abuse complaints out the wazoo.
>
> If you think it'd help, I'll be glad to post something like that once in a
> while. Do you think it would be well received? Or would I condemned as a
> self appointed ruler...


I have to say it does bother me too, so I'd say go ahead if you're a mind. I won't worry
about reactions from the somewhat clueless ones that post there. You should have a
fairly thick skin from posting here ;^)

Thinking about it, what bothers me more is those who answer questions there. I've never
checked, but apparently some do that. Maybe your posting will get them to see the light
too, or maybe they like having their own little pond.

--
Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com)
================================================== ============
* The Ultimate DBMS is here!
* FirstSQL/J Object/Relational DBMS (http://www.firstsql.com)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pygame, mouse events and threads jedi200581@yahoo.co.uk Python 4 08-25-2006 09:58 AM
runtime events that generate other controls and events newbye ASP .Net 0 07-06-2006 06:27 PM
[new to threads] threads with UI and loop Une bévue Ruby 0 06-14-2006 10:22 AM
Events Events Events Please Help Chris ASP .Net Web Controls 0 08-30-2005 08:21 PM
Passing Variables between Web Page Events and HttpModule Events shiv ASP .Net 0 11-21-2003 04:29 PM



Advertisments