Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
0xf90c committed Mar 28, 2024
1 parent aab4a6b commit 760e8cc
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions rustbook-uz/src/ch15-04-rc.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,13 @@ Biz `Rc<T>`ni ma’lumotni heapda dasturning ko‘p qismlarini o‘qishi uchun a

Shuni yodda tutish kerakki `Rc<T>` yakka-thread holatlardagina ishlatiladi. Biz 16-bo‘limda parralellik haqida suhlashganimizda, biz ko‘p threadli dasturlarda referenceni hisoblashni qanday qilishni o‘rganamiz.

### Using `Rc<T>` to Share Data
### `Rc<T>`ni Ma'lumotni Ulashish uchun ishlatish

Let’s return to our cons list example in Listing 15-5. Recall that we defined
it using `Box<T>`. This time, we’ll create two lists that both share ownership
of a third list. Conceptually, this looks similar to Figure 15-3:
Keling kamchiligi bor bo‘lgan 15-5 ro‘yxat misolimizga qaytaylik. Esingizda bo‘lsa biz `Box<T>`ni ishlatishni ko‘rsatib o‘tgan edik. Bu safar, biz 2ta ro‘yxat ham egalikni (ownership) 3-ro‘yxat bilan ulashadigan ro‘yxat yaratamiz. Aniq qilib aytadigan bo‘lsak, 15-3 shaklga o‘xshashdir:

<img alt="Two lists that share ownership of a third list" src="img/trpl15-03.svg" class="center" />

<span class="caption">Figure 15-3: Two lists, `b` and `c`, sharing ownership of
a third list, `a`</span>
<span class="caption">15-3-shakl: Ikkita ro'yxatlar, ya'ni `b` va `c` egalikni uchinchi ro'yxat, ya'ni `a`ga ulashishi</span>

We’ll create list `a` that contains 5 and then 10. Then we’ll make two more
lists: `b` that starts with 3 and `c` that starts with 4. Both `b` and `c`
Expand Down

0 comments on commit 760e8cc

Please sign in to comment.