Privacy Policy

Privacy Policy   ============== Last updated: June 08, 2024 This Privacy Policy describes Our policies and procedures on the collection, use and disclosure of Your information when You use the Service and tells You about Your privacy rights and how the law protects You. We use Your Personal data to provide and improve the Service. By using the Service, You agree to the collection and use of information in accordance with this Privacy Policy. This Privacy Policy has been created with the help of the [Privacy Policy Generator](https://www.termsfeed.com/privacy-policy- generator/). Interpretation and Definitions   ------------------------------ Interpretation   ~~~~~~~~~~~~~~ The words of which the initial letter is capitalized have meanings defined under the following conditions. The following definitions shall have the same meaning regardless of whether they appear in singular or in plural. Definitions   ~~~~~~~~~~~ For the purposes of this Privacy Policy:   * Account means a unique acc

Membuat Thread Sederhana (Bagian 2)

b.) Message writing + mp3player tanpa thread
- Install vlc player dengan perintah apt-get install vlc (pastikan tersambung dengan internet)
- ketik kode berikut :

#include <pthread.h>
#include <stdio.h>

void *read(void *ptr);
void *player(void *ptr);
int main()
{
    pthread_t tid1, tid2;
    read(NULL);
    player(NULL);    

    return 0;
}

void *read(void *ptr)
{
    char msg[100];
    while(1)
    {
        fgets(msg, 100, stdin);
        printf("%s",msg);
    }
    return 0;
}

void *player(void *ptr)
{
    system("cvlc final.mp3");
    return NULL;
}


- Simpan dengan nama threadmp3.c
- Compile dengan mengetikkan gcc threadmp3 threadmp3.c -lpthread
- Jalankan dan lihat outpunya

Komentar

Postingan populer dari blog ini

State Diagram & Analisa Rangkaian Sekuensial (Rangkaian Sekuensial 2)

Adder, Subtractor, Decoder, Encoder

Penyederhanaan Fungsi Boolean (Tabulasi), Rangkaian Kombinasional