Re: [nodejs] Doing ressource locks right

140 views
Skip to first unread message

Jann Horn

unread,
Nov 11, 2011, 4:36:25 PM11/11/11
to nod...@googlegroups.com
2011/11/11 Andi <test...@gmx.de>:
> I see that some session middlewares for connect/express do not
> consider concurrent access to the session data in a meaningful way.
> Global locks across processes are necessary! This is just one example
> for a bigger problem.

For locks, https://github.com/indutny/deadbolt seems to be interesting.

Andi

unread,
Nov 11, 2011, 4:33:14 PM11/11/11
to nodejs
I see that some session middlewares for connect/express do not
consider concurrent access to the session data in a meaningful way.
Global locks across processes are necessary! This is just one example
for a bigger problem.
Even in a single process, access to objects is not secure if you
change a central object with a function that is called inside an
event. If the function is async, then the object can be in a state
that is not correct. I am sure there are some modules that tackle this
problem within one process or across processes (using redis, for
example), that I don't know. I'd like to know more about solutions of
this kind.

This is my example considering object changes in a process
(explanation in German): https://gist.github.com/1359300

Andi

unread,
Nov 11, 2011, 5:48:59 PM11/11/11
to nodejs
I am not sure because I do not want to know if a ressource is
currently blocked but just to get the result of a computation, no
matter where it is in the queue. I want the computation to be done,
whenever it is.

On 11 Nov., 22:36, Jann Horn <jannh...@googlemail.com> wrote:
> 2011/11/11 Andi <test9...@gmx.de>:
Reply all
Reply to author
Forward
0 new messages