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@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Reply via email to