want to write a kernel module which creates 10 processes to access common varaible
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
want to write a kernel module which creates 10 processes to access common varaible
i want to write a kernel module which will spawn 10 processes ,and all these processes will update a common variable. Use of semaphores or rather spinlocks is allowed.
thanks....but I used Fork(),its givin an error (actually a warning: implicit declaration of function ‘fork’)....i used clone() its givin d same error....I want to use do_fork() but am not gettin what parameters to use in that.....or please suggest some other function.....
@pixellany: i am pursuing bachelors degree in computer science . I need this in order to check the working of semaphores and spinlocks. I am using Ubuntu 7.10. Now can u suggest some way to solve this problem please. ......n also i had written kernel modules for linked list and character device driver and block device driver...
Last edited by hrushi_kute; 09-27-2008 at 01:18 PM.
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195
Rep:
hrushi_kute, maybe the intention of this assignment is to learn you how to create multiple processes and still use shared memory. There are a few techniques for learning that.
Not only that, but those are very well documented and from the fundamentals of today's multitasking operating systems.
Since you keep asking the obvious, and apparently you did either not read the entire book, or stopped at the 'fork' chapter. I wonder once you graduated for this course how you will proceed in your professional life if you can't even put effort in finding out how to write multiple processes using shared memory.
Try to google with the keywords you gave us, and start to read.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.