Servlet singlethreadmodel partnerin gesucht kostenlos Osnabrück

durch  |  19-May-2015 21:24

You could have plenty of spare CPU power; indeed, if you had eight CPUs, this implementation would leave seven of them mostly idle.

The result is that the server listen queue would fill up quickly, and your servlet (actually, the TCP stack) would simply reject half the connections.

Servlet singlethreadmodel-24

This is independent of the CPU capability of the server.

If you like your servlet to behave like single thread, then you must implement the Single Threaded Model interface.

By implementing this interface, you're telling the container that it cannot service requests concurrently, therefore decreasing performance.

Writing your servlet with big synchronized blocks may be highly thread-safe but won't scale.

For example, the following rather extreme implementation synchronizes the entire servlet activity: public class My Very Thread Safe Servlet extends Http Servlet { ...

Forum-Mitarbeiter anzeigen