The Gateway to Computer Science Excellence
0 votes
Servers can be designed to limit the number of open connections. For example, a server may wish to have only N socket connections at any point in time. As soon as N connections are made, the server will not accept another incoming connection until an existing connection is released. Explain how semaphores can be used by a server to limit the number of concurrent connections.
in Operating System by Boss (42.3k points) | 17 views

Server process may look like

S = n; // maximum number of request that can be handled by server
mutex = 1;   
Server() {
    while(true) {
            Critical Section

Once more than n number of request arrive, server will suspend their request, but as soon as existing connection is released server will be able to accept new connections.

Please log in or register to answer this question.

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,741 questions
57,240 answers
104,600 users