This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
from threading import Thread | |
from datetime import datetime | |
def sum(results, thread_id, SUM_RANGE): | |
print(thread_id, SUM_RANGE) | |
sum = i = 0 | |
start = thread_id * SUM_RANGE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* PThread Creation */ | |
#include <stdio.h> | |
#include <pthread.h> | |
void *foo (void *arg) { /* thread main */ | |
printf("Foobar!\n"); | |
pthread_exit(NULL); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* PThread Creation Quiz 1 */ | |
#include <stdio.h> | |
#include <pthread.h> | |
#define NUM_THREADS 4 | |
void *hello (void *arg) { /* thread main */ | |
printf("Hello Thread\n"); | |
return 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* A Slightly Less Simple PThreads Example */ | |
#include <stdio.h> | |
#include <pthread.h> | |
#define NUM_THREADS 4 | |
void *threadFunc(void *pArg) { /* thread main */ | |
int *p = (int*)pArg; | |
int myNum = *p; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* PThread Creation Quiz 3 */ | |
#include <stdio.h> | |
#include <pthread.h> | |
#define NUM_THREADS 4 | |
void *threadFunc(void *pArg) { /* thread main */ | |
int myNum = *((int*)pArg); | |
printf("Thread number %d\n", myNum); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Producer Consumer */ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <pthread.h> | |
#define BUF_SIZE 3 /* Size of shared buffer */ | |
int buffer[BUF_SIZE]; /* shared buffer */ | |
int add = 0; /* place to add next element */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| AWS | | |
| -------------------------------------------------------------------------------- | | |
| API Gateway | ALB | | |
| Manages the routing and processing of API requests from clients | Distributes incoming traffic across multiple instances of service | | |
| Can implement rate limiting, bursting for APIs | No rate limiting, bursting capability | | |
| Not possible to get a static IP addresss for endpoint (always a URL) | Possible to get a static IP address for load balancer endpoint | | |
| Accepts HTTPS traffic | Accepts HTTP, HTTPS traffic | | |
| Able to do request validation(apache |