Line buffer and semaphore