Re: atomic_t

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

 



As everyone mentioned, it is to upgrade the data structure, without
affecting the existing code. It also prevents coders who liberally use
int with other datatypes like long etc. from doing so and thus also
prevents some unnoticed errors.

Hope that helps.........

One of the reasons

On Jan 3, 2008 7:59 PM, Thanos McAtos <mcatos@xxxxxxxxxxxx> wrote:
> Because that way the data type is more generic. If, in the future, it is
> decided to be changed from int to something else, you won't have to change
> anything in your code. This is a foundamental concept in ADTs and
> generally a good way of programming.
>
>
> > I wonder why atomic_t is defined as a structure containing an integer
> > rather than just a simple integer?
> > What are the advantages?
> >
> > Hope somebody can explain this, please cc me.
> >
> > --
> > To unsubscribe from this list: send an email with
> > "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
> > Please read the FAQ at http://kernelnewbies.org/FAQ
> >
> >
>
>
>
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
> Please read the FAQ at http://kernelnewbies.org/FAQ
>
>



-- 
Thanks & Regards,
********************************************
Manish Katiyar  ( http://mkatiyar.googlepages.com )
3rd Floor, Fair Winds Block
EGL Software Park
Off Intermediate Ring Road
Bangalore 560071, India
***********************************************

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[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