Lock-Free Atomic Shared Pointers Without a Split Reference Count? It Can Be Done!
and concurrency patterns • How existing atomicare implemented (the split reference count technique) • Deferred reclamation, i.e., garbage collection in C++ Some assumed knowledge • You’ve and concurrency patterns • How existing atomic are implemented (the split reference count technique) • Deferred reclamation, i.e., garbage collection in C++ Some assumed knowledge • You’ve danielanderson.net std::shared_ptr (the basics) T* ptr; shared_ptr s1: control_block: atomic ref_count = 1; … control_block* ctrl; T12 Daniel Anderson -- danielanderson.net std::shared_ptr (the 0 码力 | 45 页 | 5.12 MB | 5 月前3Data Is All You Need for Fusion
second_m_count,second_n_count,second_m_inc,second_n_inc; int m_count,n_count,k_count; int m_inc,n_inc,k_inc; for (n_count=0;n_countcount+=n_inc){ n_inc=(N-n_count>N_BLOCKING)?N_BLOCKING:N-n_count; for for (k_count=0;k_count count+=k_inc){ k_inc=(K-k_count>K_BLOCKING)?K_BLOCKING:K-k_count; m_inc=M>M_BLOCKING?M_BLOCKING:M; packing_a_k18(alpha,A+k_count*LDA,a_buffer,LDA,m_inc,k_inc); for (second_n (second_n_count=n_count;second_n_count count+n_inc;second_n_count+=second_n_inc){ second_n_inc=n_count+n_inc-second_n_count>16?16:n_count+n_inc-second_n_count; packing_b_k18(B+k_count+second_n_count*LDB,b_b 0 码力 | 151 页 | 9.90 MB | 5 月前3peewee Documentation Release 3.6.0
people and how many pets they have: for person in Person.select(): print(person.name, person.pets.count(), 'pets') # prints: # Bob 2 pets # Grandma L. 0 pets # Herb 1 pets Once again we’ve run into a a SQL function to aggregate the results. query = (Person .select(Person, fn.COUNT(Pet.id).alias('pet_count')) .join(Pet, JOIN.LEFT_OUTER) # include people without pets. .group_by(Person) order_by(Person.name)) for person in query: # "pet_count" becomes an attribute on the returned model instances. print(person.name, person.pet_count, 'pets') # prints: # Bob 2 pets # Grandma L. 0 pets0 码力 | 377 页 | 399.12 KB | 1 年前3peewee Documentation Release 3.6.0
people and how many pets they have: for person in Person.select(): print(person.name, person.pets.count(), 'pets') # prints: # Bob 2 pets # Grandma L. 0 pets # Herb 1 pets Once again we’ve run into a select(Person, fn.COUNT(Pet.id).alias('pet_count')) .join(Pet, JOIN.LEFT_OUTER) # include people without pets. .group_by(Person) .order_by(Person.name)) for person in query: # "pet_count" becomes an attribute attribute on the returned model instances. print(person.name, person.pet_count, 'pets') # prints: # Bob 2 pets # Grandma L. 0 pets # Herb 1 pets 1.2. Quickstart 9 peewee Documentation, Release 3.6.00 码力 | 302 页 | 1.02 MB | 1 年前3peewee Documentation Release 3.5.0
people and how many pets they have: for person in Person.select(): print(person.name, person.pets.count(), 'pets') # prints: # Bob 2 pets # Grandma L. 0 pets # Herb 1 pets Once again we’ve run into a a SQL function to aggregate the results. query = (Person .select(Person, fn.COUNT(Pet.id).alias('pet_count')) .join(Pet, JOIN.LEFT_OUTER) # include people without pets. .group_by(Person) order_by(Person.name)) for person in query: # "pet_count" becomes an attribute on the returned model instances. print(person.name, person.pet_count, 'pets') # prints: # Bob 2 pets # Grandma L. 0 pets0 码力 | 347 页 | 380.80 KB | 1 年前3peewee Documentation Release 3.5.0
people and how many pets they have: for person in Person.select(): print(person.name, person.pets.count(), 'pets') # prints: # Bob 2 pets # Grandma L. 0 pets # Herb 1 pets Once again we’ve run into a select(Person, fn.COUNT(Pet.id).alias('pet_count')) .join(Pet, JOIN.LEFT_OUTER) # include people without pets. .group_by(Person) .order_by(Person.name)) for person in query: # "pet_count" becomes an attribute attribute on the returned model instances. print(person.name, person.pet_count, 'pets') # prints: # Bob 2 pets # Grandma L. 0 pets # Herb 1 pets Now let’s list all the people and the names of all their0 码力 | 282 页 | 1.02 MB | 1 年前3peewee Documentation Release 3.4.0
people and how many pets they have: for person in Person.select(): print(person.name, person.pets.count(), 'pets') # prints: # Bob 2 pets # Grandma L. 0 pets # Herb 1 pets Once again we’ve run into a a SQL function to aggregate the results. query = (Person .select(Person, fn.COUNT(Pet.id).alias('pet_count')) .join(Pet, JOIN.LEFT_OUTER) # include people without pets. .group_by(Person) order_by(Person.name)) for person in query: # "pet_count" becomes an attribute on the returned model instances. print(person.name, person.pet_count, 'pets') # prints: # Bob 2 pets # Grandma L. 0 pets0 码力 | 349 页 | 382.34 KB | 1 年前3peewee Documentation Release 3.4.0
people and how many pets they have: for person in Person.select(): print(person.name, person.pets.count(), 'pets') # prints: # Bob 2 pets # Grandma L. 0 pets # Herb 1 pets Once again we’ve run into a select(Person, fn.COUNT(Pet.id).alias('pet_count')) .join(Pet, JOIN.LEFT_OUTER) # include people without pets. .group_by(Person) .order_by(Person.name)) for person in query: # "pet_count" becomes an attribute attribute on the returned model instances. print(person.name, person.pet_count, 'pets') # prints: # Bob 2 pets # Grandma L. 0 pets # Herb 1 pets Now let’s list all the people and the names of all their0 码力 | 284 页 | 1.03 MB | 1 年前3peewee Documentation Release 3.3.0
people and how many pets they have: for person in Person.select(): print(person.name, person.pets.count(), 'pets') # prints: # Bob 2 pets # Grandma L. 0 pets # Herb 1 pets Once again we’ve run into a select(Person, fn.COUNT(Pet.id).alias('pet_count')) .join(Pet, JOIN.LEFT_OUTER) # include people without pets. .group_by(Person) .order_by(Person.name)) for person in query: # "pet_count" becomes an attribute attribute on the returned model instances. print(person.name, person.pet_count, 'pets') # prints: # Bob 2 pets # Grandma L. 0 pets # Herb 1 pets Now let’s list all the people and the names of all their0 码力 | 280 页 | 1.02 MB | 1 年前3peewee Documentation Release 3.1.0
people and how many pets they have: for person in Person.select(): print(person.name, person.pets.count(), 'pets') # prints: # Bob 2 pets # Grandma L. 0 pets # Herb 1 pets Once again we’ve run into a a SQL function to aggregate the results. query = (Person .select(Person, fn.COUNT(Pet.id).alias('pet_count')) .join(Pet, JOIN.LEFT_OUTER) # include people without pets. .group_by(Person) order_by(Person.name)) for person in query: # "pet_count" becomes an attribute on the returned model instances. print(person.name, person.pet_count, 'pets') # prints: # Bob 2 pets # Grandma L. 0 pets0 码力 | 332 页 | 370.77 KB | 1 年前3
共 1000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 100