destroy memory segment on server program

Hi everyone. i have an issue with a server program i'm developing for a university project.
The issue is the following:

The server program i'm building uses shared memory and forks. However i have a problem as to how can i destroy the shared memory segments i've created. A simplified version of my code is as follows |
|
\ /
v

Hi everyone. i have an issue with a server program i'm developing for a university project.
The issue is the following:

The server program i'm building uses shared memory and forks. However i have a problem as to how can i destroy the shared memory segments i've created. A simplified version of my code is as follows |
|
\ /
v

How does the listening part of the server know that no more clients are pending without waiting?

You mentioned shared memory segments at first then you say memory segment, which is it? Does the listening server create one memory segment for all the clients? Does the listening server create one segment for each client or do you have some other scheme?

How does the listening part of the server know that no more clients are pending without waiting?

You mentioned shared memory segments at first then you say memory segment, which is it? Does the listening server create one memory segment for all the clients? Does the listening server create one segment for each client or do you have some other scheme?

it is a shared memory segment used by all the clients (haven't reached the semaphore part yet so don't worry about it). As for the listening part of the program, i honestly don't know anything because my project teamates created it. If you need the code to see for yourself what's going on in that part i'll post it but it has no comments. Just tell me if you need it.

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...

Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...