[cs33211] Re: exact requirements of project 1 part 2?

Mikhail Nesterenko mikhail at cs.kent.edu
Mon Mar 9 18:33:03 EDT 2009


Matt Wheeler wrote:
> Hello,
> 
> How important is it that cars going in the same direction do not  
> pass?  The instructions state that cars in the construction zone  
> should sleep based on the speed specified in the text file, but what  
> if this speed would result in the car overtaking the car in front of it?

No, for simplicity reasons cars in the same direction are allowed to
overtake each other.

> Must cars go in their sequence order as specified in the text file?   
> Using one condition variable to wake up many waiting cars doesn't seem  
> to guarantee that cars always go in this order.  

that is acceptable. 

> Should there be a  
> queue or something to ensure this?

no, it is not necessary.

> Also, should cars use pthread_join to wait until the car "in front" of  
> them exits the construction zone first?  In the example below, two  
> cars going the same direction and the same speed get started one right  
> after the other.  W1 entered the intersection first, and then W2 right  
> after it.  But W2 sometimes exits first.

using pthread_join is not required. 

Thanks,
--
Mikhail


More information about the cs33211 mailing list