forked from cocomr/coco
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4474eac
commit ad03cd0
Showing
14 changed files
with
282 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// | ||
// Created by pippo on 14/07/16. | ||
// | ||
|
||
#pragma once | ||
|
||
#ifdef __linux__ | ||
|
||
#include <sched.h> | ||
#include <string.h> | ||
#include <unistd.h> | ||
#include <fcntl.h> | ||
|
||
#if defined(__i386__) | ||
|
||
#ifndef __NR_sched_setattr | ||
#define __NR_sched_setattr 351 | ||
#endif | ||
#ifndef __NR_sched_getattr | ||
#define __NR_sched_getattr 352 | ||
#endif | ||
|
||
#elif defined(__x86_64__) | ||
|
||
#ifndef __NR_sched_setattr | ||
#define __NR_sched_setattr 314 | ||
#endif | ||
#ifndef __NR_sched_getattr | ||
#define __NR_sched_getattr 315 | ||
#endif | ||
|
||
#endif /* i386 or x86_64 */ | ||
|
||
#if !defined(__NR_sched_setattr) | ||
# error "Your arch does not support sched_setattr()" | ||
#endif | ||
|
||
#if !defined(__NR_sched_getattr) | ||
# error "Your arch does not support sched_getattr()" | ||
#endif | ||
|
||
/* If not included in the headers, define sched deadline policy numbe */ | ||
#ifndef SCHED_DEADLINE | ||
#define SCHED_DEADLINE 6 | ||
#endif | ||
|
||
|
||
#define sched_setattr(pid, attr, flags) syscall(__NR_sched_setattr, pid, attr, flags) | ||
#define sched_getattr(pid, attr, size, flags) syscall(__NR_sched_getattr, pid, attr, size, flags) | ||
|
||
struct sched_attr | ||
{ | ||
uint32_t size; | ||
uint32_t sched_policy; | ||
uint64_t sched_flags; | ||
/* SCHED_NORMAL, SCHED_BATCH */ | ||
int32_t sched_nice; | ||
/* SCHED_FIFO, SCHED_RR */ | ||
uint32_t sched_priority; | ||
/* SCHED_DEADLINE */ | ||
uint64_t sched_runtime; | ||
uint64_t sched_deadline; | ||
uint64_t sched_period; | ||
}; | ||
|
||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include <coco/coco.h> | ||
|
||
|
||
class WebServerTask : public coco::TaskContext | ||
{ | ||
public: | ||
|
||
|
||
coco::InputPort<std::string> in_message(); | ||
private: | ||
|
||
|
||
}; | ||
COCO_REGISTER(WebServerTask) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.