Re: Global variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jun 14, 2015 at 5:02 PM, Ruben Safir <ruben@xxxxxxxxxxxx> wrote:
> On 06/14/2015 07:28 AM, roni wrote:
>> I know i should avoid using global variables in kernel programming.
>>
>> What problem it create if i use more global variables?
>>
>>
>> _______________________________________________
>> Kernelnewbies mailing list
>> Kernelnewbies@xxxxxxxxxxxxxxxxx
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>
>>
>
>
> you step on everyone else's names space.  Do you know how many other
> people are collaborating with the kernel.  Stick to your own back yard.
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@xxxxxxxxxxxxxxxxx
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Besides, it hampers reentrancy, unless you use locks(mutex) with each
global variable.
Kernel functions can be called by different processes in parallel and
they might also be
called/scheduled from interrupt context.

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux