Skip to content

Instantly share code, notes, and snippets.

@tarunjain07
tarunjain07 / AWS_ALB_vs_APIGateway
Last active March 15, 2024 12:35
AWS ALB vs API Gateway
| 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
/* 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 */
/* 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);
/* 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;
/* 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;
/* PThread Creation */
#include <stdio.h>
#include <pthread.h>
void *foo (void *arg) { /* thread main */
printf("Foobar!\n");
pthread_exit(NULL);
}
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