In the questions I read, we suggest using threads over processes, because threads are faster. I decided to use themes for my program that edit articles in categories on Wikipedia. The program receives a list of articles for editing, and then splits the articles between 10 threads. In doing so, I make 6-7 changes per minute, and this is the same speed as if I were not using threads. When I run several instances of my program and give a category for processing for each instance, I see that each process can perform 6-7 changes per minute (I tested this with 5 processes).
Why are processes much faster in my case? and why didn't the threads change anything?
Code (not complete to have an idea):
public static wiki = new Wiki(); public process(){ String[] articles = wiki.getArticles(category); for(int i=0; i< 10; i++){ String[] part = getPart(articles, i, 10); MyThread t = new MyThread(part); list.add(t); } ExecutorService.invokeAll(list);
Hunsu source share