# Concurrency Basics (Rust) > Threads, thread::spawn, move closures, channels (mpsc), Send & Sync 트레이트, thread safety - 20 면접 질문 - Mid-Level - [면접 질문: Rust](https://sharpskill.dev/ko/technologies/rust/interview-questions.md) ## 1. Rust에서 새 스레드를 생성하려면 어떤 함수를 사용해야 하나요? **답변** std::thread 모듈의 thread::spawn 함수는 새로운 실행 스레드를 생성합니다. 클로저를 매개변수로 받고 join() 메서드로 스레드 종료를 기다릴 수 있는 JoinHandle을 반환합니다. 이 함수는 Rust에서 스레드 기반 동시성 프로그래밍의 주요 진입점입니다. ## 2. JoinHandle에서 호출한 join() 메서드는 무엇을 반환하나요? **답변** join() 메서드는 Result를 반환하며, 여기서 T는 스레드 클로저의 반환 타입입니다. 스레드가 정상적으로 종료되면 Ok(값)을 얻습니다. 스레드가 패닉을 일으키면 패닉 정보를 담은 Err을 얻습니다. 이를 통해 스레드 결과를 안전하게 가져오거나 오류를 처리할 수 있습니다. ## 3. thread::spawn에 전달하는 클로저에 move 키워드를 사용하는 이유는 무엇인가요? **답변** move 키워드는 클로저가 캡처한 변수를 빌리는 대신 ownership을 가져가도록 강제합니다. 새 스레드가 변수가 정의된 스코프보다 오래 살 수 있기 때문에 thread::spawn에서는 필수적입니다. move가 없으면 컴파일러는 참조가 스레드의 전체 라이프타임 동안 유효함을 보장할 수 없으므로 거부합니다. ## 17개 추가 질문 이용 가능 - Rust에서 Send 트레이트의 역할은 무엇인가요? - Rust에서 Sync 트레이트의 역할은 무엇인가요? 무료로 가입하기: 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 - [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 - [Tokio & Async I/O](https://sharpskill.dev/ko/technologies/rust/interview-questions/tokio-async.md): 22개 질문, 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/concurrency-basics