Quote:
Originally Posted by i.pas
Please when you are asking questions first try.
1:Search from the inrternet
2:Read from the books
after all this if you can not do nothing then ask to help you.
If you even do not start to write your project how we can help you.
Sorry i.pas because i didn't elaborate it might have given u impression that i hadn't put in enough effort. But I would like to make it clear that its not so i've gone through all possible sources where i could find help. My project is not all about semaphores but it deals with an extension of netfilter. I've coded and tested rest of modules that does not require synchronisation. Now since u desire I'll elaborate my question :
Say I have a kernel module that takes a specific routing decision based on the state of a variable and at the same time the state(value) of the variable can be asynchronously changed by another process. Now I've to make sure that the routing decision is not taken while the state is being changed (changing the state requires some communication from other systems on network and so routing decision can be taken while the state of the variable is being updated).
So for this synchronisation i need to use kernel semaphore as the processes will be running in kernel. Now just to make it direct I made a pin-pointed question that if this semaphore is a just an instance of struct semaphore whose scope is limited to the file it has been declared in how can that be used to synchronise two or more processes. This is different from what is done in sys V IPC where the semaphore has an id that it is unique over one system. And to give u an idea of my problem, i am running this application on P-II 233MHz system where it takes atleast 4-5 hrs compiling kernel (and which if ur suggestion is taken might end up in a fiasco). Add to it the fact that if my one mistake might lead my linux machine not to boot (after all u can't play with ur kernel) and end up the work that i've done thus far.
I hope that u understand the gravity of the problem now and cooperate.
I've also checked the database of forum and could not locate any similar post.
So plz. help if u can.