DEV Community

Ditikrushna Giri
Ditikrushna Giri

Posted on

Multi Thread Model

In multi thread model the server assigned incoming request to the new thread . Similar as a client server architecture the user generate a request while interacting with the application and then send to the server .

The every times a new request comes in the server map a new thread from thread pool to the incoming request then the thread is responsible for process that request and sending back the response .

The number of thread is equal to the number of thread used from the thread pools .

Now , the thread present in the thread pools are limited to the based on the resource available .

If we look closely we will find the limitation of multi thread model . Suppose we have millions of request coming in per second are the thread present in the thread pools are limited number there will be situation where all the thread are exhausted from the thread pools in that situation a incoming request has to wait until a thread process the last request and return back the result .

This is a situation of scalability which could be resolve by adding more resource and creating more thread inside the thread pools .

Limitation of Multi Thread Model :

  • In multi-thread model , for every request server creates a separate thread which handles that request .
  • If a thread acquired a lock in the shared resource and it is 'exclusive lock ' it will block other threads .

Image of Datadog

The Future of AI, LLMs, and Observability on Google Cloud

Datadog sat down with Google’s Director of AI to discuss the current and future states of AI, ML, and LLMs on Google Cloud. Discover 7 key insights for technical leaders, covering everything from upskilling teams to observability best practices

Learn More

Top comments (0)

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay