A Relaxed Guide to memory_order_relaxed
Relaxed Guide to memory_order_relaxed Hans Boehm Paul E. McKenney Google Facebook CPPCON 2020std::atomic/std::atomic_ref and memory_order_relaxed ● C++ atomic operations simple threads-as-interleaving semantics ● by passing memory_order enum values to explicit atomic operations. ● In particular, memory_order_relaxed allows arbitrary visibility reordering with respect memory_order_relaxed? ● Just a load, just a store: Full control, excellent efficiency and scalability! ○ Assuming aligned machine-sized atomic objects, that is…What is Not to Like About memory_order_relaxed0 码力 | 32 页 | 278.53 KB | 5 月前3peewee Documentation Release 3.6.0
Let’s make sure these are sorted alphabetically by adding an order_by() clause: for pet in Pet.select().where(Pet.owner == uncle_bob).order_by(Pet.name): print(pet.name) # prints: # Fido # Kitty Kitty Let’s list all the people now, youngest to oldest: for person in Person.select().order_by(Person.birthday.desc()): print(person.name, person.birthday) # prints: # Bob 1960-01-15 # Herb 1950-05-05 .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 model0 码力 | 377 页 | 399.12 KB | 1 年前3peewee Documentation Release 3.6.0
Let’s make sure these are sorted alphabetically by adding an order_by() clause: for pet in Pet.select().where(Pet.owner == uncle_bob).order_by(Pet.name): print(pet.name) # prints: # Fido # Kitty Let’s Let’s list all the people now, youngest to oldest: for person in Person.select().order_by(Person.birthday.desc()): print(person.name, person.birthday) # prints: # Bob 1960-01-15 # Herb 1950-05-05 # Grandma 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 instances0 码力 | 302 页 | 1.02 MB | 1 年前3peewee Documentation Release 3.0.0
Let’s make sure these are sorted alphabetically by adding an order_by() clause: for pet in Pet.select().where(Pet.owner == uncle_bob).order_by(Pet.name): print pet.name # prints: # Fido # Kitty Let’s list all the people now, youngest to oldest: for person in Person.select().order_by(Person.birthday.desc()): print person.name, person.birthday # prints: # Bob 1960-01-15 # Herb 1950-05-05 .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 model0 码力 | 319 页 | 361.50 KB | 1 年前3peewee Documentation Release 3.5.0
Let’s make sure these are sorted alphabetically by adding an order_by() clause: for pet in Pet.select().where(Pet.owner == uncle_bob).order_by(Pet.name): print(pet.name) # prints: # Fido # Kitty Kitty Let’s list all the people now, youngest to oldest: for person in Person.select().order_by(Person.birthday.desc()): print(person.name, person.birthday) # prints: # Bob 1960-01-15 # Herb 1950-05-05 .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 model0 码力 | 347 页 | 380.80 KB | 1 年前3peewee Documentation Release 3.5.0
Let’s make sure these are sorted alphabetically by adding an order_by() clause: for pet in Pet.select().where(Pet.owner == uncle_bob).order_by(Pet.name): print(pet.name) # prints: # Fido # Kitty Let’s Let’s list all the people now, youngest to oldest: for person in Person.select().order_by(Person.birthday.desc()): print(person.name, person.birthday) # prints: # Bob 1960-01-15 # Herb 1950-05-05 # Grandma 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 instances0 码力 | 282 页 | 1.02 MB | 1 年前3peewee Documentation Release 3.4.0
Let’s make sure these are sorted alphabetically by adding an order_by() clause: for pet in Pet.select().where(Pet.owner == uncle_bob).order_by(Pet.name): print(pet.name) # prints: # Fido # Kitty Kitty Let’s list all the people now, youngest to oldest: for person in Person.select().order_by(Person.birthday.desc()): print(person.name, person.birthday) # prints: # Bob 1960-01-15 # Herb 1950-05-05 .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 model0 码力 | 349 页 | 382.34 KB | 1 年前3peewee Documentation Release 3.3.0
Let’s make sure these are sorted alphabetically by adding an order_by() clause: for pet in Pet.select().where(Pet.owner == uncle_bob).order_by(Pet.name): print(pet.name) # prints: # Fido # Kitty Let’s Let’s list all the people now, youngest to oldest: for person in Person.select().order_by(Person.birthday.desc()): print(person.name, person.birthday) # prints: # Bob 1960-01-15 # Herb 1950-05-05 # Grandma 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 instances0 码力 | 280 页 | 1.02 MB | 1 年前3peewee Documentation Release 3.4.0
Let’s make sure these are sorted alphabetically by adding an order_by() clause: for pet in Pet.select().where(Pet.owner == uncle_bob).order_by(Pet.name): print(pet.name) # prints: # Fido # Kitty Let’s Let’s list all the people now, youngest to oldest: for person in Person.select().order_by(Person.birthday.desc()): print(person.name, person.birthday) # prints: # Bob 1960-01-15 # Herb 1950-05-05 # Grandma 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 instances0 码力 | 284 页 | 1.03 MB | 1 年前3peewee Documentation Release 3.1.0
Let’s make sure these are sorted alphabetically by adding an order_by() clause: for pet in Pet.select().where(Pet.owner == uncle_bob).order_by(Pet.name): print(pet.name) # prints: # Fido # Kitty Kitty Let’s list all the people now, youngest to oldest: for person in Person.select().order_by(Person.birthday.desc()): print(person.name, person.birthday) # prints: # Bob 1960-01-15 # Herb 1950-05-05 .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 model0 码力 | 332 页 | 370.77 KB | 1 年前3
共 1000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 100