im making a school project in c programming.. and i need some advice.
the program is about an hospital.
i have made a struct which holds the information about the patiens infomation such as social sec. nr, injury ect.
there has to be 2 processors which reseive these patiens, and they can only take on at a time. The rest have to wait in the waiting room
my quastion is how can do that?
i was thinking about creating to processors by running fork(), 2 times. and the create a pipe transferring the whole struct. Is this possible and how do i tranfor a whole struct with a pipe?
my secound quastion is how should i make sure that only the 2 processors only reseive 1 patient at a time. I was thinking about a semifor.. which i could initialize to 2... how can i do that
pls help.. and keep it as simple as possible.. im new in the field.. thanks