# Tokio & Async I/O (Rust) > Tokio runtime, async tasks, select!, join!, timeout, tokio::spawn, async 파일/네트워크 I/O - 22 면접 질문 - Senior - [면접 질문: Rust](https://sharpskill.dev/ko/technologies/rust/interview-questions.md) ## 1. 비동기 Rust 애플리케이션에서 Tokio runtime의 주요 역할은 무엇입니까? **답변** Tokio runtime은 future가 완료될 때까지 poll하는 executor를 제공합니다. 또한 여러 OS thread에 태스크를 분산시키는 멀티스레드 scheduler(기본값)와 비동기 I/O 작업을 위한 reactor도 관리합니다. runtime이 없으면 Rust future는 기본적으로 lazy하기 때문에 아무 일도 하지 않습니다. ## 2. #[tokio::main] 매크로로 Tokio runtime을 초기화하려면 어떻게 해야 합니까? **답변** #[tokio::main] 매크로는 async main() 함수를 멀티스레드 Tokio runtime을 생성하고 async 함수를 실행하는 동기 진입점으로 변환합니다. 이 매크로는 runtime을 생성하고 메인 future가 완료될 때까지 블록하는 데 필요한 boilerplate를 자동으로 생성합니다. ## 3. #[tokio::main]과 #[tokio::main(flavor = "current_thread")]의 차이점은 무엇입니까? **답변** 기본적으로 #[tokio::main]은 worker thread 풀에 태스크를 분산하는 멀티스레드 runtime을 생성합니다. flavor = "current_thread"를 사용하면 runtime이 모든 태스크를 메인 thread에서만 실행하는데, 이는 테스트, 간단한 애플리케이션 또는 thread 간 데이터 공유를 피해야 할 때 유용합니다. ## 19개 추가 질문 이용 가능 - tokio::spawn()은 무엇을 하며 어떤 타입을 반환합니까? - tokio::spawn()에 전달되는 future가 'static이어야 하는 이유는 무엇입니까? 무료로 가입하기: https://sharpskill.dev/ko/login ## 기타 Rust 면접 주제 - [Rust 기초](https://sharpskill.dev/ko/technologies/rust/interview-questions/rust-basics.md): 25개 질문, Junior - [Ownership & Borrowing](https://sharpskill.dev/ko/technologies/rust/interview-questions/ownership-borrowing.md): 22개 질문, Junior - [Structs & Enums](https://sharpskill.dev/ko/technologies/rust/interview-questions/structs-enums.md): 20개 질문, Junior - [에러 처리](https://sharpskill.dev/ko/technologies/rust/interview-questions/error-handling.md): 18개 질문, Junior - [컬렉션](https://sharpskill.dev/ko/technologies/rust/interview-questions/collections.md): 20개 질문, Junior - [모듈과 패키지](https://sharpskill.dev/ko/technologies/rust/interview-questions/modules-packages.md): 18개 질문, Junior - [Traits](https://sharpskill.dev/ko/technologies/rust/interview-questions/traits.md): 22개 질문, Mid-Level - [Generics](https://sharpskill.dev/ko/technologies/rust/interview-questions/generics.md): 20개 질문, Mid-Level - [Lifetimes](https://sharpskill.dev/ko/technologies/rust/interview-questions/lifetimes.md): 20개 질문, Mid-Level - [Iterators & Closures](https://sharpskill.dev/ko/technologies/rust/interview-questions/iterators-closures.md): 22개 질문, Mid-Level - [Smart Pointers](https://sharpskill.dev/ko/technologies/rust/interview-questions/smart-pointers.md): 22개 질문, Mid-Level - [Concurrency Basics](https://sharpskill.dev/ko/technologies/rust/interview-questions/concurrency-basics.md): 20개 질문, Mid-Level - [async/await](https://sharpskill.dev/ko/technologies/rust/interview-questions/async-await.md): 22개 질문, Mid-Level - [Testing](https://sharpskill.dev/ko/technologies/rust/interview-questions/testing.md): 18개 질문, Mid-Level - [Cargo & Ecosystem](https://sharpskill.dev/ko/technologies/rust/interview-questions/cargo-ecosystem.md): 18개 질문, Mid-Level - [Pattern Matching](https://sharpskill.dev/ko/technologies/rust/interview-questions/pattern-matching.md): 18개 질문, Mid-Level - [매크로](https://sharpskill.dev/ko/technologies/rust/interview-questions/macros.md): 20개 질문, Mid-Level - [Serde와 직렬화](https://sharpskill.dev/ko/technologies/rust/interview-questions/serde-serialization.md): 20개 질문, Mid-Level - [Unsafe Rust](https://sharpskill.dev/ko/technologies/rust/interview-questions/unsafe-rust.md): 20개 질문, Senior - [고급 트레잇](https://sharpskill.dev/ko/technologies/rust/interview-questions/advanced-traits.md): 22개 질문, Senior - [고급 lifetime](https://sharpskill.dev/ko/technologies/rust/interview-questions/advanced-lifetimes.md): 20개 질문, Senior - [Type System](https://sharpskill.dev/ko/technologies/rust/interview-questions/type-system.md): 20개 질문, Senior - [성능 최적화](https://sharpskill.dev/ko/technologies/rust/interview-questions/performance-optimization.md): 20개 질문, Senior - [Memory Management](https://sharpskill.dev/ko/technologies/rust/interview-questions/memory-management.md): 20개 질문, Senior - [Web Frameworks](https://sharpskill.dev/ko/technologies/rust/interview-questions/web-frameworks.md): 22개 질문, Senior - [Database Integration](https://sharpskill.dev/ko/technologies/rust/interview-questions/database-integration.md): 20개 질문, Senior - [Rust 디자인 패턴](https://sharpskill.dev/ko/technologies/rust/interview-questions/design-patterns.md): 20개 질문, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/ko/technologies/rust/interview-questions/tokio-async