Encerrado

Implementing a Semaphore Class Wrapper for Linux

Project: implement the class definition defined below. In your bid please tell me what primitive type/functions you will be using so that I know you have a clue. (eg, will "sem_t" be involved). If you can provide insight on how you will implement the interrupt() method, that would be great because then I'll know you understand what I want. I will give you a simple test harness (c program linked with pthreads) to test your class. If it does not clear the test harness, I will not accept the solution you provide. The header file follows:

// HEADER BEGIN

class Semaphore

{

public:

//

// Constructor - construct a Semaphore instance.

//

// The constructor with no arguments constructs a Semaphore with an initial internal count of zero.

// The constructor with an argument constructs a Semaphore with an initial internal count of "initialCount".

//

Semaphore();

Semaphore(unsigned int initialCount);

//

// Destructor - destroy a Semaphore instance.

//

// If the destructor is called when any threads are blocked in p(), they will immediately exit with

// an error state 2.

//

virtual ~Semaphore();

//

// v - increment Semaphore.

//

// returns:

// 0 == success.

// -1 == Semaphore was interrupted.

//

void v();

//

// p - decrement Semaphore.

//

// If semaphore's internal count is zero, block until a call to v() increments it.

// If the semaphore has been interrupted, this call immediately returns -1.

//

// returns:

// 0 == success.

// -1 == Semaphore was interrupted.

// 1 == wait timed out.

// 2 == Semaphore destroyed.

// Positive Value == any other error (you define).

//

int p();

int p(unsigned int timeout);

//

// interrupt Semaphore.

//

// Any threads blocked on p() will immediately return -1.

// Any threads that subsequently call p() will immediately return -1.

// Any threads calling v() will immediately return -1.

//

void interrupt();

//

// clear Semaphore interrupt.

//

// Undoes a call to interrupt(): Semaphore returns to normal behavior: calls to v() increment

// the semaphore. Calls to p() block until the semaphore is positive.

//

void clearInterrupt();

};

// HEADER END

## 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

Linux, gcc(g++) 2.96 THIS MUST WORK ON LINUX. THIS IS A REQUIREMENT. Windows, Microsoft (R) 32-bit C/C++ Optimizing Compiler Version [url removed, login to view] for 80x86. IF YOU CAN GET IT TO WORK ON Windows, THAT IS A BONUS. TELL ME IN YOUR BID IF YOU ARE BIDDING TO PROVIDE A DUAL-OS SOLUTION. Good luck and feel free to ask any questions. Do not send me a "prewritten" bid about your qualifications not pertinent to this project.

Habilidades: Programação C, Engenharia, Linux, Microsoft, MySQL, PHP, Gestão de projetos, Arquitetura de software, Teste de Software, UNIX, Área de trabalho do Windows

Ver mais: wrapper programming, what is virtual destructor, what is r programming, what is an argument in programming, what is a method in programming, what is a class in programming, virtual int, virtual destructor c, virtual destructor, virtual constructor, virtual call in constructor, semaphore programming, r programming class, programming what is a class, programming test questions, programming on linux, programming for linux, programming definition, programming define, programming constructs, programming class definition, programming class, linux programming software, linked int, int v

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

ID do Projeto: #2981039

8 freelancers estão ofertando em média $52 para este trabalho

stefanmeyer

See private message.

$34 USD in 20 dias
(29 Comentários)
5.6
mattwlazlo

See private message.

$42.5 USD in 20 dias
(5 Comentários)
4.7
sixi

See private message.

$67.99 USD in 20 dias
(11 Comentários)
2.7
vw670429vw

See private message.

$29.75 USD in 20 dias
(5 Comentários)
1.6
garethknight

See private message.

$68 USD in 20 dias
(0 Comentários)
0.0
gayathrinivas

See private message.

$42.5 USD in 20 dias
(1 Comentário)
0.0
zeer0

See private message.

$42.5 USD in 20 dias
(0 Comentários)
0.0
vw971127vw

See private message.

$85 USD in 20 dias
(0 Comentários)
0.0