implemented multithreading, but with mutex. will mit atomic operations optimieren

This commit is contained in:
any
2026-08-28 23:47:46 +02:00
parent 3d1cb713f2
commit 20ab33de33
5 changed files with 93 additions and 27 deletions
+18 -1
View File
@@ -1,4 +1,5 @@
#pragma once
#include <pthread.h>
struct vec3 {
double x, y, z;
};
@@ -55,4 +56,20 @@ struct object {
struct cube {
quad quad1,quad2,quad3,quad4,quad5,quad6;
}; typedef struct cube cube;
}; typedef struct cube cube;
typedef struct {
//int pixelId;
object *objectList;
int objectCount;
int width;
int channels;
vec3 *screenTopLeft;
vec3 *vecPixelStepX;
vec3 *vecPixelStepY;
camera *cam1;
unsigned char **image;
int nextPixelId;
pthread_mutex_t mutexKey;
int pixelCount;
} RenderArgs;