Skip to content

Operating Systems assignment about Java Synchronization ( synchronization using semaphore )

Notifications You must be signed in to change notification settings

Abdalla2030/Wifi_Synchronization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wifi_Synchronization

operating systems assignment about Java Synchronization ( Synchronization using semaphores )

It is required to simulate a limited number of devices connected to a router’s Wi-Fi using Java threading and semaphore. Routers can be designed to limit the number of open connections. For example, a Router may wish to have only N connections at any point in time. As soon as N connections are made, the Router will not accept other incoming connection until an existing connection is released.

The Wi-Fi number of connected devices is initially empty. -If a client is logged in (print a message that a client has logged in) and if it can be served (means that it can reach the internet), then the client should perform the following activities: [Connect, Perform online activity, Log out]. Note: these actions will be represented by printed messages, such that there is a random waiting time between the printed messages when a client connects, do some online activities and logged out. -If a client arrives and all connections are occupied, it must wait until one of the currently available clients finishes his service and leave. -After a client finishes his service, he leave and one of the waiting clients (if exist) will connect to the internet.

The Project contain:

1-Router Class: that contains a list of connection and methods to occupy a connection and release a connection.

2-Semaphore Class.

3-Device Class: represent different devices (threads) that can be connected to the router; each device has its own name (i.e. C1) and type (i.e. mobile, pc, tablet...) and it may perform three activities: connect, perform online activity and disconnect/logout.

4-Network Class: this class contains the main method in which the user is asked for two inputs: a-N: max number of connections a router can accept b-TC: total number of devices that wishes to connect). c-TC lines that contain: name of each device, and its type.

About

Operating Systems assignment about Java Synchronization ( synchronization using semaphore )

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages