Re: Problems starting Java threads on Linux
Monday, October 7, 2002 08:22 AM
Could be a starvation issue i.e. your main thread is taking up all of the CPU cycles and not allowing your secondary threads to get any of the cycles. Try adding a 'sleep' in your main thread. Doing this will at least let you know if it is being starved. Are you using native rather than green threads? I am not sure what threading model Linux uses by default (i.e. pre-emptive or time-sliced).
A point to note is that your thread does not necessarily run when you call the start method. all that happens at that point is that the thread is flagged as being active (i.e. available to run) so that the scheduler can run it whenever the necessary resources (i.e. CPU cycles) become available.