> Hi, I think about solution of my exercise. Here it is:
>
[quoted text clipped - 5 lines]
> Maybe some of you have solution of this? I will be thankfull for any
> help.

Signature
Knute Johnson
email s/nospam/knute/
Knute Johnson napisal(a):
> > Hi, I think about solution of my exercise. Here it is:
> >
[quoted text clipped - 18 lines]
> Knute Johnson
> email s/nospam/knute/
Yes, but buffer size is limited e.g. 10, and I don't know how to
prevent stack a b c (a must wait when a=8, b=1, and c=0)
Knute Johnson - 16 Jan 2007 17:35 GMT
> Knute Johnson napisal(a):
>>> Hi, I think about solution of my exercise. Here it is:
[quoted text clipped - 22 lines]
> Yes, but buffer size is limited e.g. 10, and I don't know how to
> prevent stack a b c (a must wait when a=8, b=1, and c=0)
You need to look at Semaphore in the documentation, that's the first
thing. I don't really know how your program is going to work because
you haven't told us. From what little I know about what you want to do,
I would use a different Semaphore for each type of part. If the whole
takes 8 a parts then you will need 8 permits in the Semaphore.
Logic flow:
A acquires permits, starts building a parts, when each part is complete
it releases a permit.
B does same
C does same
M waits until it can acquire all 3 semaphores then makes product and
when it is done it releases all semaphores

Signature
Knute Johnson
email s/nospam/knute/