Steam installieren
Anmelden
|
Sprache
简体中文 (Vereinfachtes Chinesisch)
繁體中文 (Traditionelles Chinesisch)
日本語 (Japanisch)
한국어 (Koreanisch)
ไทย (Thai)
Български (Bulgarisch)
Čeština (Tschechisch)
Dansk (Dänisch)
English (Englisch)
Español – España (Spanisch – Spanien)
Español – Latinoamérica (Lateinamerikanisches Spanisch)
Ελληνικά (Griechisch)
Français (Französisch)
Italiano (Italienisch)
Bahasa Indonesia (Indonesisch)
Magyar (Ungarisch)
Nederlands (Niederländisch)
Norsk (Norwegisch)
Polski (Polnisch)
Português – Portugal (Portugiesisch – Portugal)
Português – Brasil (Portugiesisch – Brasilien)
Română (Rumänisch)
Русский (Russisch)
Suomi (Finnisch)
Svenska (Schwedisch)
Türkçe (Türkisch)
Tiếng Việt (Vietnamesisch)
Українська (Ukrainisch)
Ein Übersetzungsproblem melden
⠀⠀⠀⠀⠀⠀⢴⣿⣿⣿⣿⣿⣏⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠈⠿⣿⣿⣿⣿⣷⣄⢀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄⠀⠀⠀
⠀⢀⣴⣧⣄⠀⠀⠀⠀⠙⢻⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⠉⠿⣿⣿⣿⣿⣷⣄⠀
⢴⣿⣿⣿⣿⣶⣀⠀⠀⠀⠀⢘⣿⣿⣿⣿⣿⣿⣏⠀⠀⠀⠀⠉⠿⣿⣿⣿⣿⡷
⠀⠙⠿⣿⣿⣿⣿⣶⣄⢀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠉⠻⡿⠋⠀
⠀⠀⠀⠉⢿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⠘⢻⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⢉⣿⣿⣿⣿⣿⡷⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠉⢿⡿⠋⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀
عيد فطر مبارك وسعيد ولاتنسانا من سلة الحلويات و الحلقوم
🍥🍬🍭🍡🍫🍥🍬🍭🍡🍫🍥🍬🍭🍡🍫🍥🍬🍭🍡🍫
for (int i = 0; i < N - 1; i++) {
for (int j = i + 1; j < N; j++) {
if (at > at[j]) {
int temp = at ;
at = at[j];
at[j] = temp;
temp = bt ;
bt = bt[j];
bt[j] = temp; } } }
#include <stdlib.h>
#include <pthread.h>
#include <time.h>
#define N 10 // Number of processes
int at[N], bt[N]; // Arrival times and burst times for processes
// Function to generate random processes
void generate_processes() {
int available_times[30];
for (int i = 0; i < 30; i++) {
available_times = i + 1;
}
// Shuffle available times for random arrival times
for (int i = 29; i > 0; i--) {
int j = rand() % (i + 1);
int temp = available_times ;
available_times = available_times[j];
available_times[j] = temp;
}
// Assign random arrival and burst times
for (int i = 0; i < N; i++) {
at = available_times ;
bt = rand() % 5 + 1; // Random Burst Time between 1 and 5
}
}
srand(time(NULL)); // Seed for random number generation
generate_processes(); // Generate arrival and burst times
pthread_t fcfs_thread, srtf_thread;
// Create threads for FCFS and SRTF scheduling algorithms
pthread_create(&fcfs_thread, NULL, fcfs, NULL);
pthread_create(&srtf_thread, NULL, srtf, NULL);
// Wait for threads to complete
pthread_join(fcfs_thread, NULL);
pthread_join(srtf_thread, NULL);
return 0;
}