Merge branch 'master' of ssh://gitlab.os-k.eu:222/gem-graph-team/gem-graph-server
This commit is contained in:
commit
65628bc569
2
Makefile
2
Makefile
|
@ -24,7 +24,7 @@ LDFLAGS= -lc -lpthread
|
||||||
BINDIR=bin
|
BINDIR=bin
|
||||||
SRCDIR=src
|
SRCDIR=src
|
||||||
DEBDIR=debian
|
DEBDIR=debian
|
||||||
OBJ=$(BINDIR)/scheduler.o $(BINDIR)/server.o $(BINDIR)/localthread.o $(BINDIR)/main.o
|
OBJ=$(BINDIR)/scheduler.o $(BINDIR)/server.o $(BINDIR)/localworker.o $(BINDIR)/main.o
|
||||||
|
|
||||||
.DEFAULT_GOAL:= all
|
.DEFAULT_GOAL:= all
|
||||||
.PHONY: all clean deb
|
.PHONY: all clean deb
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
//=-------------------------------------------------------------------------=//
|
//=-------------------------------------------------------------------------=//
|
||||||
// Scheduler definition //
|
// Local workers definition //
|
||||||
// //
|
// //
|
||||||
// Copyright © 2021 The Gem-graph Project //
|
// Copyright © 2021 The Gem-graph Project //
|
||||||
// //
|
// //
|
||||||
|
@ -22,3 +22,5 @@
|
||||||
#ifndef BASE_H
|
#ifndef BASE_H
|
||||||
#include "../include/base.h"
|
#include "../include/base.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,19 @@
|
||||||
|
|
||||||
pthread_t *SchedInit(SchedulerParams_t *parameters);
|
pthread_t *SchedInit(SchedulerParams_t *parameters);
|
||||||
|
|
||||||
int SchedWait(pthread_t *schedThread);
|
// -------------------------------------------------------------------------- //
|
||||||
|
// Scheduler destructor function //
|
||||||
|
// -------------------------------------------------------------------------- //
|
||||||
|
static inline int SchedDestroy(pthread_t *schedThread)
|
||||||
|
{
|
||||||
|
free(schedThread);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int SchedDestroy(pthread_t *schedThread);
|
// -------------------------------------------------------------------------- //
|
||||||
|
// Scheduler wait function //
|
||||||
|
// -------------------------------------------------------------------------- //
|
||||||
|
static inline void SchedWait(pthread_t *schedThread)
|
||||||
|
{
|
||||||
|
pthread_join(*schedThread, NULL);
|
||||||
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
|
|
||||||
void SchedulerCrashTest(void)
|
void SchedulerCrashTest(void)
|
||||||
{
|
{
|
||||||
const int maxthread = 2000;
|
const int maxthread = 16;
|
||||||
|
|
||||||
SchedulerParams_t *parameters =
|
SchedulerParams_t *parameters =
|
||||||
(SchedulerParams_t*) calloc(1, sizeof(SchedulerParams_t));
|
(SchedulerParams_t*) calloc(1, sizeof(SchedulerParams_t));
|
||||||
|
@ -97,7 +97,7 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
free(parameters);
|
free(parameters);
|
||||||
|
|
||||||
SchedulerCrashTest();
|
//SchedulerCrashTest();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
//=-------------------------------------------------------------------------=//
|
//=-------------------------------------------------------------------------=//
|
||||||
|
|
||||||
#include "../include/base.h"
|
#include "../include/base.h"
|
||||||
#include "../include/localthread.h"
|
#include "../include/localworker.h"
|
||||||
|
|
||||||
static void *GreatScheduler(void *parameters);
|
static void *GreatScheduler(void *parameters);
|
||||||
|
|
||||||
|
@ -36,23 +36,6 @@ pthread_t *SchedInit(SchedulerParams_t *parameters)
|
||||||
return parameters->id;
|
return parameters->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------------------- //
|
|
||||||
// Scheduler destructor function //
|
|
||||||
// -------------------------------------------------------------------------- //
|
|
||||||
int SchedDestroy(pthread_t *schedThread)
|
|
||||||
{
|
|
||||||
free(schedThread);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------------- //
|
|
||||||
// Scheduler wait function //
|
|
||||||
// -------------------------------------------------------------------------- //
|
|
||||||
void SchedWait(pthread_t *schedThread)
|
|
||||||
{
|
|
||||||
pthread_join(*schedThread, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
// Scheduler thread main function //
|
// Scheduler thread main function //
|
||||||
// -------------------------------------------------------------------------- //
|
// -------------------------------------------------------------------------- //
|
||||||
|
|
Loading…
Reference in New Issue