Skip to content

closekn-sandbox/ConcurrentProgramming

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Concurrent Programming

directory

  • TCP (Network Program (socket by TCP))
    • server.c
    • client.c
  • proccess
    • prod2cons.c (Producer Consumer Problem using proccess)
  • Thread
    • determinant.c (Calculation of determinant using threads)
    • prod2cons.c (Producer Consumer Problem using threads)
  • janken (socket by TCP)

TCP

Compile

> make

Server-side run

Lock file version
> ./server-lock <file-name>
No lock file version
> ./server-nolock <file-name>

file-name : Specify the file name to log

Client-side run

> ./client <server-name> <client-name> <repeat-count>

server-name : Server-side's name or IP
client-name : A name that can identify the client that is running this program
repeat-count : Number of times to repeat message sending and receiving

proccess

Compile

> make

Run

> ./prod2cons <buffer-size> <number-of-producer> <number-of-consumer> <repeat-count>
Can confirm parallel access of producer process and consumer process of ring buffer which is shared memory.

Do the time taken from process creation as the final output as follows.
<Real time>,<CPU time>

thread

Compile

> make

determinant

> ./determinant <matrix-size> <number-of-thread>

prod2cons

> ./prod2cons <buffer-size> <number-of-producer> <number-of-consumer> <repeat-count>

janken

Compile

> make

parent

> ./parent
Open port 20000

child

> ./child <server-name> <CPU-name>

server-name : Name of server on which parent program is running

About

Communication between client and server, communication between processes, etc.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors