Airport using semaphores and shared memo

Hi
just doin' this here for the naval school, back here in Pportugal, and needed some help, especially with the shared memo i want to use for the 10 airport gate, and the maximum of 4 planes preparing to leave; can�t figure out how the gate can be id by the same PID. WELL, if someone wants to know the general, the main idea is to create PIDs on a program done in unix bases, that should work in 2 modes (switch), one on automatic (just puting in the frequency of generating the planes) and the manual conf, by putting in the max of planes to generate and the frequency; only 15 planes are allowed in the air, the others are sent to an other airport;one at a time in the landing route, four gate for passagers move in, and 4 allowed to leave.
Will appreciate your help
greets:b:

We have a homework forum which we require you use for homework, following the template you will find in it. The rules are a little more stringent due to considerations about cheating, but we're still quite willing to help if you follow them. Thanks