> What about implementing a little scheduler in Java? I mean, Java *does*
> pre-emt even green threads if there's another threads of *higher* priority
> running.
> 
> So, as I believe has been mentioned before, it would be possible to use the
> three thread priorities to implement a green-threads scheduler.
> 
> Has anyone done this? I guess it's not much code involved. so I guess I'll
> be trying it anyway, but what about the performance loss? Is it large?

Yes, we have done this on AutO, a distributed system of autonomous
objects. The system executes code supplied by many different users
and we had to take precautions against code which does not voluntarily
release the CPU. We have a daemon thread running at Thread.MAX_PRIORITY
which sleeps 100ms in an endless loop. We did not try to tune this time
slice, but we didn't experience any slowdown during normal operation.


CU,
Stefan


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to