Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Threaded or not

 
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
Bartender
Posts: 6587
86
  • 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.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!