mcavage / node-bdb

node.js bindings for Berkeley DB
Other
33 stars 8 forks source link

Make compile on FreeBSD 9.0 #3

Closed christianlavoie closed 11 years ago

christianlavoie commented 12 years ago

Hey, this is needed to make the code compile on my FreeBSD 9.0 box.

node -v

v0.6.17

npm -v

1.1.21

pkg_cutleaves -l | egrep '(v8|db)'

db48-4.8.30.0 v8-3.7.3

mcavage commented 12 years ago

I really should delete this project - you don't want this :\

Node + BDB is kind of a fail given BDB's assumptions about threading model and Node's threading model.

On Tue, Jun 5, 2012 at 7:28 PM, Chris Lavoie reply@reply.github.com wrote:

Hey, this is needed to make the code compile on my FreeBSD 9.0 box.

node -v

v0.6.17

npm -v

1.1.21

pkg_cutleaves -l | egrep '(v8|db)'

db48-4.8.30.0 v8-3.7.3

You can merge this Pull Request by running:

 git pull https://github.com/christianlavoie/node-bdb master

Or you can view, comment on it, or merge it online at:

 https://github.com/mcavage/node-bdb/pull/3

-- Commit Summary --

  • Make compile with recent bdb on FreeBSD.
  • Make compile with recent bdb on FreeBSD.
  • Merge branch 'master' of github.com:christianlavoie/node-bdb

-- File Changes --

M src/bdb_db.cc (30) M src/bdb_db.h (10) M src/bdb_env.cc (6) M src/bdb_env.h (2)

-- Patch Links --

 https://github.com/mcavage/node-bdb/pull/3.patch  https://github.com/mcavage/node-bdb/pull/3.diff


Reply to this email directly or view it on GitHub: https://github.com/mcavage/node-bdb/pull/3

christianlavoie commented 12 years ago

Could you expand on this a bit? What's the underlying problem?

On Tue, Jun 5, 2012 at 11:09 PM, Mark Cavage reply@reply.github.com wrote:

I really should delete this project - you don't want this :\

Node + BDB is kind of a fail given BDB's assumptions about threading model and Node's threading model.

On Tue, Jun 5, 2012 at 7:28 PM, Chris Lavoie reply@reply.github.com wrote:

Hey, this is needed to make the code compile on my FreeBSD 9.0 box.

node -v

v0.6.17

npm -v

1.1.21

pkg_cutleaves -l | egrep '(v8|db)'

db48-4.8.30.0 v8-3.7.3

You can merge this Pull Request by running:

 git pull https://github.com/christianlavoie/node-bdb master

Or you can view, comment on it, or merge it online at:

 https://github.com/mcavage/node-bdb/pull/3

-- Commit Summary --

  • Make compile with recent bdb on FreeBSD.
  • Make compile with recent bdb on FreeBSD.
  • Merge branch 'master' of github.com:christianlavoie/node-bdb

-- File Changes --

M src/bdb_db.cc (30) M src/bdb_db.h (10) M src/bdb_env.cc (6) M src/bdb_env.h (2)

-- Patch Links --

 https://github.com/mcavage/node-bdb/pull/3.patch  https://github.com/mcavage/node-bdb/pull/3.diff


Reply to this email directly or view it on GitHub: https://github.com/mcavage/node-bdb/pull/3


Reply to this email directly or view it on GitHub: https://github.com/mcavage/node-bdb/pull/3#issuecomment-6142128

Have fun, Christian http://linkedin.christianlavoie.net

"I won't let you fall apart."

mcavage commented 12 years ago

Hi - sorry it took me a while to find where I wrote this - ironically it was on GH issues:

https://github.com/mcavage/node-bdb/issues/2#issuecomment-4503342

Lemme know if that makes sense or not. I mean, short of it is that I can take this PR, but I would really advise that if you're looking to use bdb, you just use leveldb, as it doesn't have the same threading assumptions (I've used BDBs for 10+ years, so I'm not an expert on their scale, seeing as it's 20+ years old, but I am really familiar with it). I naively thought when I started this that node could be coerced into working with it. I believe I was wrong.

m

christianlavoie commented 12 years ago

So, in theory, as long as transactions don't span entering/leaving nodejs event handlers (as in, libev handlers) everything "should" work -- it's really when trying to keep transactions opened between threads that something goes bonkers. That's clearly awful in the general case, but happens to be good enough for me, for now.

Thanks for taking the time to answer, appreciated. Feel free to delete your old code if you want, I'll maintain my own until I can migrate to something saner.

On Wed, Jun 6, 2012 at 11:28 AM, Mark Cavage reply@reply.github.com wrote:

Hi - sorry it took me a while to find where I wrote this - ironically it was on GH issues:

https://github.com/mcavage/node-bdb/issues/2#issuecomment-4503342

Lemme know if that makes sense or not. I mean, short of it is  that I can take this PR, but I would really advise that if you're looking to use bdb, you just use leveldb, as it doesn't have the same threading assumptions (I've used BDBs for 10+ years, so I'm not an expert on their scale, seeing as it's 20+ years old, but I am really familiar with it).  I naively thought when I started this that node could be coerced into working with it. I believe I was wrong.

m


Reply to this email directly or view it on GitHub: https://github.com/mcavage/node-bdb/pull/3#issuecomment-6153621

Have fun, Christian http://linkedin.christianlavoie.net

"I won't let you fall apart."

mcavage commented 12 years ago

Yes, in theory that's true. Practically (as in non-theoretically) speaking, db->txn_begin ... op db->txn_commit are almost assuredly going to span threads, since your JS will simply be handing off to the thread pool. You're almost guaranteed that the operations "won't line up". Anyway, good luck ;)

On Sat, Jun 9, 2012 at 9:36 PM, Chris Lavoie reply@reply.github.com wrote:

So, in theory, as long as transactions don't span entering/leaving nodejs event handlers (as in, libev handlers) everything "should" work -- it's really when trying to keep transactions opened between threads that something goes bonkers. That's clearly awful in the general case, but happens to be good enough for me, for now.

Thanks for taking the time to answer, appreciated. Feel free to delete your old code if you want, I'll maintain my own until I can migrate to something saner.

On Wed, Jun 6, 2012 at 11:28 AM, Mark Cavage reply@reply.github.com wrote:

Hi - sorry it took me a while to find where I wrote this - ironically it was on GH issues:

https://github.com/mcavage/node-bdb/issues/2#issuecomment-4503342

Lemme know if that makes sense or not. I mean, short of it is  that I can take this PR, but I would really advise that if you're looking to use bdb, you just use leveldb, as it doesn't have the same threading assumptions (I've used BDBs for 10+ years, so I'm not an expert on their scale, seeing as it's 20+ years old, but I am really familiar with it).  I naively thought when I started this that node could be coerced into working with it. I believe I was wrong.

m


Reply to this email directly or view it on GitHub: https://github.com/mcavage/node-bdb/pull/3#issuecomment-6153621

Have fun, Christian http://linkedin.christianlavoie.net

"I won't let you fall apart."


Reply to this email directly or view it on GitHub: https://github.com/mcavage/node-bdb/pull/3#issuecomment-6225857