Re: [PATCH 04/11] libports: lock-less reference counting for port_info objects

2014-05-13 Thread Samuel Thibault
Justus Winter, le Tue 13 May 2014 12:54:33 +0200, a écrit : > I'm aware of that. Note that _ports_complete_deallocate aquires the > _ports_htable_lock and checks if someone reacquired a reference > through the hash table. It should be explained how the whole figure works as a comment somewhere in

Re: [PATCH 04/11] libports: lock-less reference counting for port_info objects

2014-05-13 Thread Justus Winter
Quoting Samuel Thibault (2014-05-13 00:28:38) > Justus Winter, le Mon 12 May 2014 12:05:42 +0200, a écrit : > > - pthread_mutex_lock (&_ports_lock); > >pthread_mutex_lock (&_ports_htable_lock); > > > >if (_ports_htable.nr_items == 0) > > @@ -60,13 +59,12 @@ _ports_bucket_class_iterate (s

Re: [PATCH 04/11] libports: lock-less reference counting for port_info objects

2014-05-12 Thread Samuel Thibault
Justus Winter, le Mon 12 May 2014 12:05:42 +0200, a écrit : > - pthread_mutex_lock (&_ports_lock); >pthread_mutex_lock (&_ports_htable_lock); > >if (_ports_htable.nr_items == 0) > @@ -60,13 +59,12 @@ _ports_bucket_class_iterate (struct port_bucket *bucket, >if ((bucket == NULL ||

[PATCH 04/11] libports: lock-less reference counting for port_info objects

2014-05-12 Thread Justus Winter
* libports/ports.h (struct port_info): Use the new type. * libports/lookup-port.c: No need to lock _ports_lock anymore. * libports/bucket-iterate.c: Likewise. * libports/complete-deallocate.c: Check if someone reacquired a reference through a hash table lookup. * libports/create-internal.c: Use the