Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Threaded or not  RSS feed

 
naveen yadav
Ranch Hand
Posts: 384
Java MyEclipse IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

i am developing a browser application using swing api. should this applocation be single threaded or multithreaded ?
what kind of thread concerns are there in a brower applcation ??
 
Stephan van Hulst
Saloon Keeper
Posts: 6969
109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, when you load a page, you can break it up in several tasks. You can have a worker that constructs the page, a worker that downloads images, etc. It depends on whether you want elements to load concurrently. For a simple browser however, I suggest you start by loading and constructing the entire page with just one thread.

For user interaction though, you would need more threads. Of course there's the event dispatch thread, which should start up a worker thread when you click a link.

Note that a browser is a pretty ambitious project. You have to parse HTML, CSS, and possibly other languages, unless you use third party libraries.
 
naveen yadav
Ranch Hand
Posts: 384
Java MyEclipse IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Stephan.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!