İşletim Sistemleri (Bahar-2016) Hafta-12
#include<iostream> #include<pthread.h> using namespace std; void* asal(void* arg) { long sayi = (long)(int*) arg; int sayac=0; for(int i=2;i<(sayi/2)+1;i++) if(sayi%i==0) {
Okumaya devam et#include<iostream> #include<pthread.h> using namespace std; void* asal(void* arg) { long sayi = (long)(int*) arg; int sayac=0; for(int i=2;i<(sayi/2)+1;i++) if(sayi%i==0) {
Okumaya devam etThread ile asal sayılar: #include<iostream> #include<unistd.h> #include<pthread.h> using namespace std; void * islem1(void *arg) { cout<<“THREAD BASLADI!!::1″<<endl; for(int sayi=100;sayi<2000;sayi++) {
Okumaya devam et| P | S | Ç | P | C | C | P |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | ||||

Son yorumlar