Hello everyone. I will try to explain my question the best way i can, however my lack of knowledge on the subject-which is the reason for this thread- may make things confusing.
I am currently working on a project for a class, which requires me to "mess around" with linux scheduler. (At this point i should say that i had never used linux till 2 months ago). Now,i will post a link which i assume is very helpful on the subject,
Click Here, but still im having trouble. I installed linsched as described,currently have its directory on my home folder, but how can i import the linsched api in my project using codeblocks, and where can i see a documentation of this api?
To make my question as simple as i can, could someone provide me with some easy steps to build a simple linsched project/test or other info, so i can understand how to use it? Thank you for your time. I hope i described my problem well, and i hope i posted it in the right topic..! thanks!
Dani AI
Short, practical correction and path forward for (and a quick note for ): LinSched is a user-space simulator that hosts the Linux kernel scheduler (it lets you run the scheduler code in a user process for easy debugging), not a replacement for cron. Cron (crontab) is a time-based job launcher; it does not model or replace the kernel CPU scheduler. (kernel.googlesource.com)
Fast way to get useful hands‑on work (recommended):
- Clone the LinSched tree (the active mirror is in the kernel trees) and work inside tools/linsched. (kernel.googlesource.com)
- The repo already contains tests and a harness; copy or edit a test in tools/linsched/tests (see tests/basic_tests.c for patterns) and then build with
makein the linsched directory. Usemake run_all_teststo validate. (kernel.googlesource.com)
This path is easier than trying to “import an API” into Code::Blocks: the test harness sets up topologies, task creation helpers and runs the simulated clock for you.
Minimal example (drop a new source into tools/linsched/tests or use as a reference in your project):
#include "linsched.h"
int main(void)
{
struct linsched_topology topo = TOPO_QUAD_CPU;
linsched_init(&topo); /* init simulator */
struct task_data *td = linsched_create_sleep_run(50, 100);
linsched_create_normal_task(td, 0); /* create one task */
linsched_run_sim(60000); /* run 60s simulated time */
return 0;
} The functions shown above are from the linsched headers and tests—use them as templates when adding your own tests or small programs. (kernel.googlesource.com)
Troubleshooting / cautions: build inside the repo (tools/linsched) with a reasonably new GCC (README suggests gcc 4.4+), run on a 64‑bit Linux userland if possible, and remember LinSched is single‑threaded simulation — it does not model lock contention or some SMP artifacts, so results focus on scheduler policy correctness rather than raw locking performance. If using Code::Blocks, either point it at the linsched sources/headers and call the repo Makefile, or edit/add files under tools/linsched/tests and use the existing Make targets. (kernel.googlesource.com)
Hello,
Linux has built in scheduler called cron (or crontab) which you can find information on just about anywhere. man cron on any linux system shuld give you the basic manual and if nothing else google man cron and you will get the linix and unix manual pages.
Here is a link to one of many pages on the subject.
http://www.adminschoice.com/crontab-quick-reference/
or if nothing else:
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.