the project

* create 16 child processes, each process consequently picks up a bank and sorts it as in the step 1 above. The banks are sorted in place, in *increasing* order.

* for this step call the function void inplace_sort(int *vector, int size) that sorts the bank starting from pointer vector and ending at pointer vector+size-1. Use your own implementation for this function.

* start step 2 and aggregate every 2 banks into one bank using all 16 processes. Do this until the number of sorted banks is equal to 16. Use the function void inplace_merge(char *vector, int size) that merges the bank from pointer vector to vector+size/2-1 with the bank from vector+size/2 to vector+size-1. Use your own implementation for this function.

* the parent process waits until all the array is sorted then verifies the correctness of the sorting with the function int verify_interval(const int* vector, int size). This function is to return 0 in the case of success or any non-null value otherwise.

* the parent process prints the time spent during sorting.

Since the synchronization in choosing the banks involves shared variables stored in the shared memory area, each read/write access may cause race conditions. In order to correctly write your program, you should protect each access using semaphores.

**Part 2: Thread-based sorting using a work queue**

You are required to write a program, called *sortt.c*, that sorts an array of data using exactly 16 threads. The program divides the array into exactly 128 banks. Execution command should be: prompt> ./sortt <n>where <n> stands for the size of the array to be sorted. (Ex: ./sortp 262144 sorts an 262144 size array of characters, starting with 16 threads and 128 banks. The initial size of the bank will be 2048 characters).

## Deliverables

1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.

2) Installation package that will install the software (in ready-to-run condition) on the platform(s) specified in this bid request.

3) Exclusive and complete copyrights to all work purchased. (No GPL, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site).

## Platform

unix SunOs 5.8

Habilidades: Software Integrado, Engenharia, MySQL, PHP, Arquitetura de software, Teste de Software

Ver mais: vector queue, vector order, vector int, read vector, program data vector, int size, correctness, read process memory, project using queue, order synchronization, 2048, unix project, semaphores shared memory, software implementation process, value engineering, vector array, implementation queue using array, bank software source code, queue thread, thread queue, project done engineering, data synchronization, create size project, php thread function, access array

Acerca do Empregador:
( 0 comentários ) United States

ID do Projeto: #2981342

1 freelancer está ofertando em média $24 para este trabalho


See private message.

$23.8 USD in 4 dias
(22 Comentários)