Comments (5)
I want to implement a kernel thread library that supports mutilcores.
Currently I have trouble to write plain thread_create
,thread_join
,thread_exit
,thread_yield
on top of your CKernel Class.
Could you give me some advices to implement CTask using those semantics?
from circle.
Circle provides a cooperative non-preemptive scheduler. This was first implemented to allow the networking code run virtually in the background. It requires support of the other tasks running on the system. Each task has to give up the CPU by calling CScheduler::Yield() or CScheduler::Sleep() from time to time, so that the other tasks can run. A task can also be blocked from execution and awaken later.
Circle provides the class CMultiCoreSupport which allows to use the secondary CPU cores of the Raspberry Pi 2 and 3 for dedicated tasks. In an environment with both CScheduler and CMultiCoreSupport, CScheduler and its tasks should run on core 0. So one can do other things on core 1, 2 and 3. I believe, the implementer of an (embedded) application knows better which tasks to run on which core, better than the system can know this on its own.
This implementation of a scheduler in Circle is relatively simple. But because one of my design goals for Circle is, to keep it as simple as possible (to be understandable) it perfectly fits into this. A preemptive scheduler makes many things a lot more complicated. One point here is, that the functions must be re-entrant.
Nevertheless a project to implement an preemptive scheduler using Circle could be interesting. But I had not the time to think about, how this can be managed. It would require some work to find this out and this is not an easy task. So good luck, if you want to do this, but this is not mainline Circle any more.
from circle.
Sure. Thanks for your reply.
I am currently trying to implement a scheduler class on top of your CMultiCoreSupport class. So each core got their own schedulers. I think my roadmap is to figure
- define thread api that works well, especially the context switch part with time handler interrupt
- implement synchronization objects like Locks and Conditional Variables on top of your spinlock and entercritical().
- figure out how to do interprocess interrupt with scheduler class
There are a lot of hardware primitive to support the necessary functions in this case, and I am quite new to Arm. And my goal here is to implement an OS that is up to modern standard. So I hope in the future you wont mind if I ask more questions regard to arm assembly.
from circle.
OK. I let this issue open. I did not write large code sections in ARM assembly, only small handlers and stubs. But perhaps I can help.
from circle.
No question in four months. I think this can be closed.
from circle.
Related Issues (20)
- USB CDC/ACM gadget HOT 19
- GetClockTicks without wrap HOT 3
- GPU support on Raspi 4 HOT 4
- Circle linker failure with softfp HOT 2
- Make USB gadget vendor and device strings configurable HOT 2
- Support for touchscreens with additional reports in HID descriptor HOT 7
- Question about log when testing with Qemu HOT 2
- Help with setting PREFIX HOT 4
- Question: Waveshare 5'' DSI display support? HOT 2
- Waveshare 15.6inch Capacitive Touch Screen HOT 2
- Can I run OpenCV? HOT 2
- Sample "07-usbstorage" fails with Pi5 HOT 8
- Unsuportted USB touch screen driver - Big Tree Tech HDMI7 HOT 10
- How to do GPIOPin button Interrupt correctly HOT 23
- FIQ support on RPI Zero 2 HOT 3
- How to remove all text not from own CSerialDevice HOT 11
- Ability to set HDMI output refresh rate HOT 3
- About memory management on CM4 HOT 2
- Building circle-stdlib w/Circle: This header is not available in freestanding mode. HOT 6
- I2S simultaneous input+output HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from circle.