This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: CSE 410 Summer 2008 PROJECT ASSIGNMENT #2 60 POINTS Your source files must be dated on or before midnight, Monday, 23 June 2008 . OVERALL OBJECTIVE You are to write a C or C++ concurrent Shearsort program using POSIX PTHREAD library and semaphore operations. You are NOT to use fork() calls, pipes, or message queues in this exercise. The Shearsort is a simple mesh-sorting algorithm that consists of nothing more than alternately sorting rows and columns of the mesh. In particular, it sorts all the rows in Phases 1, 3, . . . , log 2 N + 1, and all the columns in Phases 2, 4, . . . , log 2 N , where N is the total number of elements. The columns are sorted so that smaller numbers move upward. The odd rows (1, 3, . . . , N- 1) are sorted so that smaller numbers move leftward, and the even rows (2, 4, . . . , N ) are sorted in reverse order ( i.e. , so that smaller numbers move rightward). The numbers will appear in a snakelike order after 2 log 2 N + 1 = log 2 N + 1 phases. An example is given in Figure+ 1 phases....
View Full Document