Skip to content

implement: src/concurrency -- rayon parallel stats over full season data #11

@BryanChasko

Description

@BryanChasko

topic: concurrency

rust's ownership model makes data-race-free concurrency a compile-time guarantee.
rayon adds effortless parallelism via par_iter().

concepts to demonstrate

  • std::thread::spawn + join
  • channels: mpsc::channel for inter-thread communication
  • Arc<Mutex<T>> for shared mutable state
  • rayon par_iter() for parallel data processing

patriots theme

parallel stat aggregation across all 2004 regular season games.
spawn a thread per week, compute weekly box scores, send results back via channel.
then rayon version: games.par_iter().map(compute_box_score).collect().

file

src/concurrency/parallel_stats.rs

note

rust-only concept. no python mirror. show how this compares to python's GIL limitations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions