11
votes
3answers
258 views

Pi Benchmarking in C

I wrote the following program to calculate n digits of Pi (where n could be anything, like 10M) in order to benchmark the CPU and it works perfectly (without OpenMP): ...
6
votes
1answer
1k views

Client server application for file transfer

I have an application for transferring files from clients to a server. A client opens, transfers a file to the server and closes. The server is open and may receive multiple files. Also, when ...
5
votes
1answer
56 views

Consumer-Producer Problem: POSIX Thread

I have implemented a producer consumer problem, following the resources below: Oracle doc CSEE I have used mutex_t and ...
4
votes
2answers
81 views

Making an array whose elements are defined by a struct [closed]

This might be a basic question for C. I'm making a struct called check_t and I want to make an array whose elements are of type ...
4
votes
1answer
1k views

Lock free MPMC Ring buffer implementation in C

I have written a lock free MPMC FIFO in C based on a ring buffer. It uses gcc's atomic built-ins to achieve thread safety. The queue is designed to return -1 if it's full on enqueue or empty on ...
4
votes
1answer
36 views

Scalability of C server implementation based on pthreads

I am wondering about the feasibility of the following basic implementation of a server and how well it would scale. I know that large-scale, distributed servers should probably be written in a ...
3
votes
2answers
3k views

Multithreaded Socket code to connect to 100 different machines

This is my socket.cpp ...
3
votes
2answers
420 views

Implementing a shared array cache without locking

Edited 3/27/2012 to explain selection of answer: After giving this some more thought, I have come around to William Morris' view (see accepted answer) that this is basically the wrong approach. I am ...
2
votes
1answer
860 views

mutex and condition variable implementation using futex

I have implemented mutex and contition variables using futex syscall. I believe that my implementation is correct, but would like it to be verified by some one else. If some of you could verify its ...
2
votes
1answer
78 views

1 Producer, N Consumers working in parallel, each doing ~1/nth of a task

I am not wondering about error checking (will add that soon). I would like to know about correctness, efficiency and simplicity? ...
1
vote
1answer
39 views

Printing a range of numbers using configurable worker threads

I have written code to print a range of numbers using multi-threaded programming. It takes in the number of threads to spawn as input. It is working fine and giving the expected results. I just ...
1
vote
1answer
3k views

Producer-consumer in C using pthread_barrier

We're preparing for an exam at the moment, and our lecturer has given us a sample problem to work on. I have it completed, but would like to know a) If it is actually doing what it's supposed to, and ...