Win a copy of Secure Financial Transactions with Ansible, Terraform, and OpenSCAP this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

download multiple files

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all
in a a file sharing program , i want to downlaod
somefiles at the same time so i wrote in the Listener's of the downlaod Button .
new Downlaod(some params).start();
to start a new thread with every new file to download , but the result is not what i expected
the result is that every time i start new thread
the previus one stoped.
could anyone hlep my
thanks
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd guess you have a collision with all the threads trying to use the same resource. When a new thread grabs the resource, the prior thread fais. Maybe a socket?
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the result is that every time i start new thread
the previus one stoped.

How exactly does it stop? Is the thread still alive? Did it throw an exception? Waiting to enter a synchronized block somewhere? Try putting some logging statements into the thread's code, so that you have more information about exactly where it is and what it's doing. If you still can't figure it out, try posting some of the code here - specifically, the code that downloads a single file.
 
If you two don't stop this rough-housing somebody is going to end up crying. Sit down and read this tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic