Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lock problem


  • From: Leo.Kislov at gmail.com (Leo Kislov)
  • Subject: lock problem
  • Date: 15 Mar 2007 23:31:39 -0700

On Mar 15, 2:31 pm, Ritesh Raj Sarraf <r... at researchut.com> wrote:

[snip]

>         os.environ['__kabc_ldap'] = temp_file_name

[snip]

> Now as per the above code, "aa" is the first string which will be executed in
> Thread-1. In my query to the ldap server, I am getting a record which matches
> the "aa" string. I've verified it by putting a breakpoint and checking the
> value.
>
> The problem is that when I run the program manually, I don't get the data from
> the first thread i.e. of the string "aa".
>
> I'm not sure if there's something wrong in the code mentioned above or is it
> really a lock problem.
>
> Can somebody please help about where I'm doing any mistake ?

You're changing environmental variable __kabc_ldap that is shared
between your threads. Environment is not designed for that kind of
usage, it was designed for settings. Either use an option to set
output file or just redirect stdout. If the interface of ldapsearch is
so lame that it requires environmental variable use env to set the
variable: "env __kabc_ldap=/tmp/wrjhdsf ldapsearch ..."

  -- Leo