/philosophers

ft_philosopher 단계별

Primary LanguageC

philosophers

> Mandatory

./philo_one "number_of_philosophers" "time_to_die" "time_to_eat" "time_to_sleep" ["number_of_times_each_philosopher_must_eat"]

  • number_of_philosophers: 철학자의 수 (즉, 생성 되어야 할 thread의 수)
  • time_to_die: 철학자가 마지막 식사 시간으로부터 다음 번 식사 전까지 살 수 있는 시간
  • time_to_eat: 철학자가 밥을 먹는 데에 걸리는 시간
  • time_to_sleep: 철학자가 잠을 자는 시간
  • number_of_times_each_philosopher_must_eat: 철학자의 최소 식사 횟수 -> optional (모든 철학자가 최소 횟수만큼 식사를 다 했다면 프로그램 종료)

> Bonus

./philo_one "number_of_philosophers" "time_to_die" "time_to_eat" "time_to_sleep" ["number_of_times_each_philosopher_must_eat"]

  • number_of_philosophers: 철학자의 수 (즉, 생성 되어야 할 프로세스의 수)
  • time_to_die: 철학자가 마지막 식사 시간으로부터 다음 번 식사 전까지 살 수 있는 시간
  • time_to_eat: 철학자가 밥을 먹는 데에 걸리는 시간
  • time_to_sleep: 철학자가 잠을 자는 시간
  • number_of_times_each_philosopher_must_eat: 철학자의 최소 식사 횟수 -> optional (모든 철학자가 최소 횟수만큼 식사를 다 했다면 프로그램 종료)