bitops or mutex

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

 



Hi,

There is a bitmap that needs to be locked across many threads for test
/ set bit operations. Which one is faster - bitops or mutex ?

1. Bitops :
set_bit(5, (long unsigned *)&tmp);

2. Mutex :
mutex_lock(&m);
*tmp = (*tmp) | (1 << 5);
mutex_unlock(&m);

Regards.

_______________________________________________
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