• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Weird Thread Behaviour

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am confused the thread behaviour i am getting.
Scenario is like this ..
I am starting 2 threads one will read from the databse (using stored procedure).Both thread start and then once control comes to second thread which, is doing SP processing, it blocks the CPU (i.e control doesn't go back to thread 1). Is it because of socket issue?
Regards,
 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is your operating system? Some do time-slicing, some do round robin, some just run a thread until interrupted. What if you changed the priority of the thread that isn't getting a chance to run to a higher priority? Does that at least give you some CPU time? Also, make sure you're not implementing a thread's code in any sort of actionEvent or anything weird like that - code running in there doesn't give up control until it is complete or broken out of. Also, as a troubleshooting idea, can you manually interrupt the second thread to continue running the first one? As for socket or networking issues, I can't comment on that, sorry. I haven't gotten that far yet.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic