Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Weird Thread Behaviour  RSS feed

 
Balbhadra Singh
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • 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,
 
David Crossett
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!