22 lines
608 B
C++
22 lines
608 B
C++
#include <cstdint>
|
|
#include <cstdio>
|
|
#include "list.hpp"
|
|
|
|
#define N 0x8
|
|
|
|
// Create all of memory
|
|
block memory[N] = {0};
|
|
// create the three lists
|
|
list freelist = {0}, list1 = {0}, list2 = {0};
|
|
|
|
int main (int argc, char* argv[]) {
|
|
// initialize the freelist
|
|
list_init(&freelist, memory, N);
|
|
// print the freelist
|
|
list_print(&freelist);
|
|
//TODO: Create producer, transformer, and consumer
|
|
//TODO: Create POSIX shared memory, and put memory, freelist, list1, list2 in it
|
|
//TODO: Use pthreads to split execution
|
|
//TODO: Implement a semaphore solution to the problem
|
|
}
|