public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
From: Ross Johnson <rpj@ise.canberra.edu.au>
To: "Medina, Aurelio" <aureliom@crt.com>
Cc: Pthreads Developers List <pthreads-win32@sourceware.cygnus.com>
Subject: RE: read/write locks
Date: Thu, 09 Sep 1999 22:21:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.05.9909101503530.11279-100000@swan.canberra.edu.au> (raw)
In-Reply-To: <F931488C3634D11180D700A02461E24502035B07@chitmd03.nt.il.nbgfn.com>

Hi,

Re the read/write lock routines, I'll see if I can get them into the
next snapshot, but it may be the one after so that I don't delay
too long in getting recent bug fixes into the DLL.

Ross

On Thu, 9 Sep 1999, Medina, Aurelio wrote:

> To all,
> 
> Speaking of read/write locks, does anyone know if the POSIX read/write lock
> routines (e.g. pthread_rwlock_init()) that I submitted will eventually
> become part of the Pthreads-Win32 library?  Seems like someone is already
> working on another implementation.  The routines that I submitted were
> introduced in UNIX98 and are currently a X/Open standard.  These routines
> are portable and are currently available on HP-UX 11.0.
> 
> Thanks,
> Aurelio Medina
> 
> 	-----Original Message-----
> 	From:	Mikael.Ambrus@elema.siemens.se
> [SMTP:Mikael.Ambrus@elema.siemens.se]
> 	Sent:	Thursday, September 09, 1999 10:47 AM
> 	To:	pthreads-win32@sourceware.cygnus.com
> 	Subject:	pthread_cond_timedwait
> 
> 		[Ambrus Mikael]  Dear pthreads colleagues, 
> 
> 		I'm writing a program that uses pthread_cond_timedwait. In
> the book
> 	that I'm using (Pthreads Programming by Nicols, Buttlar & Proulux
> Farell )
> 	it says that this function should suspend the thread until some
> other thread
> 	calls  pthread_cond_signal, pthread_cond_broadcast OR the system
> timer is
> 	greater than or equal to the third argument (abstime). 
> 
> 		Since clock_gettime is not implemented and I cant find some
> other
> 	function that tells me the system time, I've tried to implement my
> own
> 	version of clock_gettime by using the ansi function clock(). This
> function
> 	returns the number of ticks that has elapsed since the program was
> started.
> 
> 		But it seams that this is not the same absolute time that
> 	pthread_cond_timedwait requires since the thread won't awaken.
> 
> 		Is there another way to acquire the relevant system time?
> 
> 		Another thing that has bothered me is that I recently
> downloaded the
> 	latest snip of phtreads and now my read/write locks won't work.
> Since the
> 	precompiled lib isn't recognised by the linker (neither with gcc
> v20.1 nor
> 	MSVC 6.0) for some reason, I built the libs using the buildlib.bat
> provided.
> 	Here's a snip of the code that fails:
> 
> 		int pthread_rdwr_wunlock_np (
> 		   pthread_rdwr_t *rdwrp
> 		){
> 		   assert( pthread_mutex_lock(&(rdwrp->mutex)) == 0 );
> 		   if (rdwrp->writers_writing == 0) {
> 		      assert( pthread_mutex_unlock(&(rdwrp->mutex)) == 0 );
> 		      return(-1);            
> 		   }else{
> 		      rdwrp->writers_writing = 0;
> 		      assert(pthread_cond_broadcast(&(rdwrp->lock_free)) ==
> 0);
> 
> 		   };
> 
> 		   assert( pthread_mutex_unlock(&(rdwrp->mutex)) == 0 );
> 		   return(0);
> 		};
> 
> 		pthread_cond_broadcast returns EINVAL. Does anyone recognise
> this
> 	problem?
> 
> 		Wkr
> 		Michael Ambrus
> 		Siemens Elema
> 	>  
> 

+----------------------+---+
| Ross Johnson         |   | E-Mail: rpj@ise.canberra.edu.au
| Info Sciences and Eng|___|
| University of Canberra   | FAX:    +61 6 2015227
| PO Box 1                 |
| Belconnen  ACT    2616   | WWW:    http://willow.canberra.edu.au/~rpj/
| AUSTRALIA                |
+--------------------------+


      reply	other threads:[~1999-09-09 22:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-09  9:39 pthread_cond_timedwait Medina, Aurelio
1999-09-09 22:21 ` Ross Johnson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.05.9909101503530.11279-100000@swan.canberra.edu.au \
    --to=rpj@ise.canberra.edu.au \
    --cc=aureliom@crt.com \
    --cc=pthreads-win32@sourceware.cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).