PatchworkOS  10941b4
A non-POSIX operating system.
Loading...
Searching...
No Matches
main.c File Reference
#include <stdatomic.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <sys/defs.h>
#include <threads.h>
#include <time.h>
Include dependency graph for main.c:

Go to the source code of this file.

Macros

#define PRIME_MAX   (10000000)
 

Functions

bool is_prime (uint64_t n)
 
static void count_primes (uint64_t start, uint64_t end)
 
static int thread_entry (void *arg)
 
static void benchmark (uint64_t threadAmount)
 
int main (void)
 

Variables

static atomic_long count
 
static atomic_long next
 

Macro Definition Documentation

◆ PRIME_MAX

#define PRIME_MAX   (10000000)

Definition at line 9 of file main.c.

Function Documentation

◆ is_prime()

bool is_prime ( uint64_t  n)

Definition at line 14 of file main.c.

Here is the caller graph for this function:

◆ count_primes()

static void count_primes ( uint64_t  start,
uint64_t  end 
)
static

Definition at line 40 of file main.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ thread_entry()

static int thread_entry ( void arg)
static

Definition at line 51 of file main.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ benchmark()

static void benchmark ( uint64_t  threadAmount)
static

Definition at line 69 of file main.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main()

int main ( void  )

Definition at line 101 of file main.c.

Here is the call graph for this function:

Variable Documentation

◆ count

atomic_long count
static

Definition at line 11 of file main.c.

◆ next

atomic_long next
static

Definition at line 12 of file main.c.