How do I use semaphore to block POSIX threads?

How do I use semaphore to block POSIX threads?

Post by Kaustubh Kulkarn » Wed, 25 Apr 2001 15:41:10



Hi!!!

I wanted to know how I can block POSIX threads using semaphores ?

If there is any other better way then please let me know.

Thanks,

Kaustubh Kalyan Kulkarni.

*****************************************************************************************************
Computer Engineering Department

Address:
1120 E Lee Blvd.,
Apt#171,
Starkville,
MS 39759.

Tel No: (662)-324-6371



****************************************************************************************************

 
 
 

How do I use semaphore to block POSIX threads?

Post by Frank Sch?nher » Wed, 25 Apr 2001 16:59:21


Hi !

a semaphore block processes against each other. To block threads against
threads, use a mutex.
pthread_mutex_....()


> Hi!!!

> I wanted to know how I can block POSIX threads using semaphores ?

> If there is any other better way then please let me know.

> Thanks,

> Kaustubh Kalyan Kulkarni.

> *****************************************************************************************************
> Computer Engineering Department

> Address:
> 1120 E Lee Blvd.,
> Apt#171,
> Starkville,
> MS 39759.

> Tel No: (662)-324-6371



> ****************************************************************************************************


 
 
 

How do I use semaphore to block POSIX threads?

Post by Norman Blac » Thu, 26 Apr 2001 05:09:16


Check out semaphore.h

--
Norman Black
Stony Brook Software
the reply, fubar => ix.netcom


Quote:

> Hi!!!

> I wanted to know how I can block POSIX threads using semaphores ?

> If there is any other better way then please let me know.

> Thanks,

> Kaustubh Kalyan Kulkarni.

****************************************************************************
*************************
> Computer Engineering Department

> Address:
> 1120 E Lee Blvd.,
> Apt#171,
> Starkville,
> MS 39759.

> Tel No: (662)-324-6371




****************************************************************************
************************
 
 
 

1. Using semaphores to block POSIX threads

Hi!!!

I wanted to know how POSIX threads can be blocked using sem_wait()?

If there is any other method available then also let me know.

Thanks,

Kaustubh Kalyan Kulkarni.

*****************************************************************************************************
Computer Engineering Department

Address:
1120 E Lee Blvd.,
Apt#171,
Starkville,
MS 39759.

Tel No: (662)-324-6371



****************************************************************************************************

2. Java and Linux

3. EACCES error when using POSIX Threads and non-blocking sockets

4. Direct Telnet for Root on Solaris 2

5. POSIX Thread Safe Semaphores & FreeBSD questions

6. Networking Problem - Stuckup Machine?!?

7. POSIX threads, thread-specific data: what about the "main" thread?

8. accelerated X 4.x

9. Sys V Semaphores vs. POSIX Semaphores??

10. using Posix/SystemV semaphores under Linux RH 6.2

11. Semaphore/thread mutex in multi threaded app.

12. does linux JDK 1.1.x use posix threads (pthreads) or green threads?

13. memory leak in (v)fprintf under solaris 2.5.1 using Posix threads