Are there libraries for IPC Queues?

I want to make a program that finds primes and saves them at the same time. Thread 1 will find the primes. If Thread 1 finds a prime, then Thread 1 sends the computed prime to Thread 2 through a queue or some data structure. Thread 2 will serialize the primes and write them into a file.

```
fn is_prime(n: u64) -> bool {
let limit = (n as f64).sqrt() as u64;
for i in 2..=limit {
if n % i == 0 {
return false;
}
}
true
}
fn main() {
let mut queue;
//Thread 1 Find Prime Numbers
thread::spawn(|| {
let mut number = 3;
loop
{
if is_prime(number)
{
//Send to Thread 2
queue.send(number);
}
number = number + 1;
}
});
//Thread 2 Save Primes into files
loop
{
if queue.len() > 0
{
for prime in queue
{
let data = format!("{}",prime );
let filename = format!("{}.txt",prime );
fs::write(filename, data).expect("Unable to write file");
}
}
}
}
```