Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: Modperl2 + mpm_event + seemingly forgotten global vars

by Marshall (Canon)
on Mar 28, 2017 at 23:15 UTC ( [id://1186289]=note: print w/replies, xml ) Need Help??

in reply to Modperl2 + mpm_event + seemingly forgotten global vars

You say "I try to keep some filehandles and datastructures simply on a "our" variable."

When using threads that modify shared data which is "global the the entire process", there needs to be some kind of locking mechanism. A thread has to acquire an "exclusive write lock" versus its other "thread peers" in order to update that commonly shared information. I don't see any locking code that would adjudicate write/read conflicts amongst its peer threads. It is possible that one thread might read a variable during the writing of that variable by another thread.

I don't know much about the server software that you are using, but I'm sure that some other Monks do. However, unlocked shared variable sounds like a likely suspect to me.

  • Comment on Re: Modperl2 + mpm_event + seemingly forgotten global vars

Replies are listed 'Best First'.
Re^2: Modperl2 + mpm_event + seemingly forgotten global vars
by spellila (Initiate) on Mar 29, 2017 at 11:24 UTC

    I agree, but only under following condition:

    - the threads are sharing their vars

    - the threads are changing their vars

    I don't see any condition matching at this case. The global var is shared only to the scope it was created. This means to thread it self. Thats ok for my case. On this way i can initate handles and keep them per thread. Each thread having its own handles should be no problem, do it?

    So every thread will create its own "our" variable. And after the creation it should stay there. This works fine for low numbers of connections. But under pressure it gets reinitilized on and on.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1186289]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-14 23:40 GMT
Find Nodes?
    Voting Booth?

    No recent polls found