Win a copy of Zero to AI - A non-technical, hype-free guide to prospering in the AI era this week in the Artificial Intelligence and Machine Learning 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Weird Thread Behaviour

 
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,
 
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.
 
You totally ruined the moon. You're gonna hafta pay for that you know. This tiny ad agrees:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic