comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Subject : locks, semaphores, and such
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Subject : locks, semaphores, and such [message #29058 is a reply to message #29048] Mon, 28 January 2002 09:17 Go to previous messageGo to previous message
Ken Mankoff is currently offline  Ken Mankoff
Messages: 158
Registered: February 2000
Senior Member
On Mon, 28 Jan 2002, Paul van Delst wrote:

> Ken Mankoff wrote:
>> I need to create a unique directory to do some work in. This is a
>> web-based IDL script (through ION), and multiple people may access the
>> site at the same second. Each user gets their images generated in a
>> uniquely named directory, which is then deleted 5 minutes later...

[ snip ]

> I had a similar problem a while back related to running batch jobs
> via unix shell scripts, but I think my problem was much simpler
> than yours and my solution is probably also too simple an approach
> (don't know nuthin' 'bout semaphores and such...) But anyway....
>
> I create a time_date string and prefix that with the username (or
> some other user specific ID). This prevents users from running
> into each other. To prevent the user from running into him/herself
> (if a single user is running multiple jobs) I suffix the
> user_time_date string with increasing integers (up to some
> predefined max value.), e.g. if directory "user_time_date" exists,
> I check for "user_time_date_2". If that exists I increment the
> suffixed integer and loop. etc. etc. So far it's worked fine -
> I've initiated 10's of 1000's of jobs (some simultaneously but
> doing the job submission through multiple windows; other not
> necessarily simultaneously since it takes some time to process the
> inputs, but over about a minute or so) and haven't yet had a
> collision. (Fingers crossed)

Actually, you gave me a very good solution. I will append the users IP
address to the directory. That way, I only have to worry about users
from the same IP accessing the page in the same second. This is much
less likely. Also, rather than use SYSTIME( 1 ) to get the seconds, I
will use a millisecond timestamp.

Thanks,
Ken Mankoff

--
Kenneth Mankoff
LASP://303.492.3264
http://lasp.colorado.edu/~mankoff/
http://lasp.colorado.edu/snoedata/
http://lasp.colorado.edu/marsrobot/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Object graphics under Linux: are they supposed to be that slow?
Next Topic: Arithmetic error

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 07:19:16 PDT 2025

Total time taken to generate the page: 0.50746 seconds