Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
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.
| |
|
Topic: Windows CreateSemaphore inCGI |
|
Author |
|
DocDJ
Joined: 11 Oct 2009 Posts: 18
|
Posted: Wed 10 Jul '13 20:29 Post subject: Windows CreateSemaphore inCGI |
|
|
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: 7373 Location: Germany, Next to Hamburg
|
|
Back to top |
|
DocDJ
Joined: 11 Oct 2009 Posts: 18
|
Posted: Thu 11 Jul '13 17:26 Post subject: |
|
|
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. |
|
Back to top |
|
|
|
|
|
|