Consider the Sun Solaris operating system for user level and kernel level threading? Explain only pros and
Question:
Consider the Sun Solaris operating system for user level and kernel level threading? Explain only pros and cons of Solaris OS threading approach?
Question
Compile the following program in Ubuntu Linux, attach all steps screenshots. Remover semantics and syntax errors before compilation.
#include
#include
#include
#include
// Let us create a global variable to change it in threads
int g = 0;
// The function to be executed by all threads
void *myThreadFun(void vargp)
{
// Store the value argument passed to this thread
int myid = (int *)vargp;
// Let us create a static variable to observe its changes
static int s = 0;
// Change static and global variables
++s; ++g;
// Print the argument, static and global variables
printf("Thread ID: %d, Static: %d, Global: %d", *myid, ++s, ++g);
}
int main()
{
int i;
pthread_t tid;
// Let us create three threads
for (i = 0; i < 3; i++;)
pthread_create(&tid, NULL, myThreadFun(), (void *)&tid);
pthread_exit(NULL);
return 0;
}
Value at Risk The New Benchmark for Managing Financial Risk
ISBN: 978-0071464956
3rd edition
Authors: Philippe Jorion