Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2005

Tip: Looking for answers? Try searching our database.

J2ME Mutiple threads appending to same form?

Thread view: 
timnels@gmail.com - 13 Jun 2005 17:35 GMT
I've got a TimerTask thread that's getting GPS readings every few
minutes,pushing them up to a server on the Internet, and appending
output to a form that was passed in the constructot.  I've got another
thread that upon a command button scans a barcode, pushes that up to a
server, and outputs to the same form that was (again) passed in the
constuctor.  Should I be able to append items to the form from multiple
threads?  It seems like one thread does not recognize the other threads
items... since sometimes the one thread seems unable to delete the
other
threads items on the same form and the items get mixed together.
Any ideas? Thanks.
Shane Wealti - 13 Jun 2005 18:09 GMT
I think you're only supposed to do form updates from one thread.  I'm
not sure if J2ME deals with this the same way but check into the
invokeLater() method which will make your updates on the event
processing thread.
Darryl Pierce - 26 Jun 2005 15:09 GMT
> I think you're only supposed to do form updates from one thread.  I'm
> not sure if J2ME deals with this the same way but check into the
> invokeLater() method which will make your updates on the event
> processing thread.

No, it doesn't. Swing works that way, the LCDUI does not.

Signature

Darryl L. Pierce <mcpierce@gmail.com>
Visit my homepage: http://mcpierce.multiply.com
"By doubting we come to inquiry, through inquiry truth." - Peter Abelard

Darryl Pierce - 26 Jun 2005 15:09 GMT
> I've got a TimerTask thread that's getting GPS readings every few
> minutes,pushing them up to a server on the Internet, and appending
[quoted text clipped - 3 lines]
> constuctor.  Should I be able to append items to the form from multiple
> threads?

Yes, you can do that. There's nothing about the LCDUI that precludes
more than one thread appending to a Form.

> It seems like one thread does not recognize the other threads
> items... since sometimes the one thread seems unable to delete the
> other
> threads items on the same form and the items get mixed together.

Again, there's nothing in the LCDUI the prevents multi-threaded access,
and there's nothing about the Item set of classes that attaches an Item
to a particular Thread. What code are you using to identify an Item and
then remove it from the Form? Please share the code so we can examine it
together.

Signature

Darryl L. Pierce <mcpierce@gmail.com>
Visit my homepage: http://mcpierce.multiply.com
"By doubting we come to inquiry, through inquiry truth." - Peter Abelard



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.