Unix Technical Forum

Re: Question on win32 semaphore simulation

This is a discussion on Re: Question on win32 semaphore simulation within the pgsql Hackers forums, part of the PostgreSQL category; --> > > (2) the killer function is PGSemaphoreReset(). There is no direct > > function for this in Win32 ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Hackers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-12-2008, 03:04 AM
Magnus Hagander
 
Posts: n/a
Default Re: Question on win32 semaphore simulation

> > (2) the killer function is PGSemaphoreReset(). There is no direct
> > function for this in Win32 either.

>
> If you can do PGSemaphoreTryLock, then Reset need only be a
> loop around it (cf. posix_sema.c). In current usage Reset
> doesn't have to be very efficient at all, because it's only
> used during backend startup to bring the semaphore to a known state.
>
> > (1) semctl(SETVAL, val=0) - there is no other "val" than

> zero is used;
>
> Really? Better look again.
>
> If you think the SysV interface is baroque (which I don't
> disagree with), then you should just get rid of it entirely
> and implement pg_sema.h directly atop the Windows primitives.
> I don't have a lot of sympathy for "let's implement just
> part of SysV because I don't like that other part". There is
> no contract saying that sysv_sema.c might not start using
> SysV features it doesn't use today.


That's what I was thinking when I said "option 3". It shouldn't be *too*
hard, and much cleaner.

//Magnus

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:48 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com