logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Windows CreateSemaphore inCGI
Author
DocDJ



Joined: 11 Oct 2009
Posts: 18

PostPosted: Wed 10 Jul '13 20:29    Post subject: Windows CreateSemaphore inCGI Reply with quote

I am trying to use the Windows CreateSemaphore in a C++ CGI function to provide protection against multi-write-access to a file (within the webserver address space) by multiple instances of my CGI program. I guess I have 3 questions:
1. Will APACHE prevent the multi-access for me?
2. Can I get Apache to prevent multiple instances of the CGI from running at the same time (they are VERY short (millisec long) programs
3. If the answers to the above 2 are "no", can I get help on using CreateSemaphore, because mine always return NULL? (I've tried simple examples with no DACL, unnamed semaphore, etc.)
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Thu 11 Jul '13 13:41    Post subject: Reply with quote

1.) No
2.) No

3.) MSDN might your friend

http://msdn.microsoft.com/en-us/library/windows/desktop/ms686946%28v=vs.85%29.aspx
Back to top
DocDJ



Joined: 11 Oct 2009
Posts: 18

PostPosted: Thu 11 Jul '13 17:26    Post subject: Reply with quote

I've added the CreateSemaphore and tried it with the default parameters (NULL, 0, 1, NULL) before trying the more complex parameters with a DACL, etc. but it returns an error. So I suspect there is some difference in using CreateSemaphore ina CGI program than when using it in a standalone application.

If anyone has already done this, I would appreciate some hints. Sad
Back to top


Reply to topic   Topic: Windows CreateSemaphore inCGI View previous topic :: View next topic
Post new topic   Forum Index -> Apache