Right now I have a program with a Gui that indexes a url that I specify. I need to index 15 things at a time and I have been just opening 15 windows of the program and individually inputting the urls that i want to index. However these 15 url's change every hour or so... I have a separate program that stores these 15 constantly changing urls in a table in my mysql database. I am able to fetch these urls from my database(I store them in an arraylist) but im not sure how to go about multi-threading my application so that i dont have to do the manual work of inputing the urls into my application.
My question: Can someone give me an example/link me to a tutorial of how I would go about creating a new thread for each url in my arraylist(also this arraylist will change so will i need to make a new thread for changing this arraylist aswell?)
Ive looked at the java site on concurrency and high level concurrency but didn't really understand the examples they gave(I am still a beginning programmer so please bear with me)
Hopefully I explained what im trying to do with enough detail Thanks in advance
EDIT: The urls i index change every couple of seconds which is why i dont think i can go through my method with each url one after another, hence why i believe it needs to be multithreaded?
2nd EDIT(I believe these guys understand what im asking):
@Jon Storm There are two issues going on 1) Getting URL list 2) Accessing said URLs. I would make the URL fetcher single-threaded and then dispatch out to a Thread Pool of fetchers. This dispatcher can also queue pending fetches, etc. – pst
@Jon Storm: could you please update your question to describe what you want to do more explicitely? If In understood correctly, you want to index a list of 15 URLs again and again, because the contents of the pages at these URLs changes every 3 seconds. And you want to update the list of URLs to index every hour, by getting them from a database. Is that right? – JB Nizet