
Liblfds, a portable, license-free, lock-free data structure library written in C - striking
http://www.liblfds.org/?
======
troymc
"If however for legal reasons a licence is required, the license of your
choice will be granted."

Very well, I want an exclusive license, meaning I'm the only person who can
use this software. Also perpetual, of course, so the license never expires.
And don't forget to indemnify me. But don't bother indemnifying yourself, so I
can sue you if the software doesn't do everything I ever dreamed. And...

(I'm being sarcastic here. My point is that you can't get away with not
licensing your free software, or saying the equivalent of "I don't care." It's
not like there's a dearth of free licenses to choose from.)

~~~
jnky
I don't know about the specific intentions of the author, but I also refuse to
put an explicit license on my code, because I firmly believe that code cannot
be owned, sold or licensed anymore than the Pythagorean theorem can. In that
sense, I consider the refusal to put a bunch of legalese nonsense on/near my
code a form of protest against the current copyright laws. I'm here to write
code and I don't want to put a license on my work just to appease some
lawyers, as it lends credibility to a system that I reject on principle. Doing
it this way only presents a problem for people and companies who subscribe to
the view that copyright is indeed a real thing.

~~~
currysausage
So, you accept potential legal hassle for you and the users of your software
in order to "protest against the current copyright laws"?

 _> I'm here to write code_

Exactly. So why not just add a brief MIT license [1] to your code, painlessly
clarifying your legal stance?

[1]
[https://en.wikipedia.org/wiki/MIT_License#License_terms](https://en.wikipedia.org/wiki/MIT_License#License_terms)

~~~
jnky
> So, you accept potential legal hassle for you and the users of your software
> in order to "protest against the current copyright laws"?

Yes.

> Exactly. So why not just add a brief MIT license [1] to your code,
> painlessly clarifying your legal stance?

Because that does not clarify my legal stance at all. My legal stance is that
code does/can/should not have a license and that no license is necessary to
use any code. I feel like adding a license (even a permissive one) undermines
this very idea.

The only people who insist on a license are exactly the people that this form
of protest is meant to oppose.

~~~
Nursie
>> My legal stance is that code does/can/should not have a license and that no
license is necessary to use any code.

Is this an aspirational stance? Because at the moment that's not what the law
says (in any country I know of) and simple licenses like the MIT are probably
the easiest way to legally say that you're allowing any use the recipient
likes.

~~~
adrusi
Actually something with strong copyleft semantics might actually be more
appropriate than MIT in this case (if we're already willing to legitimize the
copyright system by having a license, which is necessary).

If the argument is that everyone should be free to use whatever code however
they want, then MIT lets delivers on the "however", but not the "whatever".
GPL slightly limits the "however", but delivers on some of the "whatever" due
to its viral nature.

------
haberman
The first two questions I want to know when I see a lock-free library:

    
    
        - how does it handle the ABA problem?
        - how does it handle the safe memory reclamation problem?
    

The answers to these questions were not easy to find for this library.

It appears that it solves the ABA problem by requiring DCAS (double-compare-
and-swap). This rules out some platforms:

"Note that the Alpha, IA64, MIPS, PowerPC and SPARC architectures do not
provide contigious double-word compare-and-swap and as such, liblfds cannot be
ported to those architectures."
\--[http://liblfds.org/documentation/mediawiki/index.php?title=r...](http://liblfds.org/documentation/mediawiki/index.php?title=r6.1.1:Porting_Guide_\(lfds\)#Detailed_Platform_Requirements)

An earlier release had a note that the library could theoretically be ported
to an architecture supporting LL/SC instead (load-linked/store-conditional),
but this note seems to have been removed in later versions:

"Currently, liblfds has been ported only to platforms which provide a
contigious double-word compare-and-swap (x86, x64 and ARM). It is entirely
possible to port to a platform which instead provides load-link/conditional-
store where non-load-linked loads can be performed inside the LL/SC pair (this
is how ABA is solved using single word LL/SC) but this has not yet been done
and it is not reasonable to ask a third party to undertake such a port until
I've done it and documented it."
\--[http://liblfds.org/documentation/mediawiki/index.php?title=r...](http://liblfds.org/documentation/mediawiki/index.php?title=r6:Porting_Guide#Detailed_Platform_Requirements)

I could not readily find an answer to the question of how safe memory
reclamation is handled. When elements are removed they are placed on a
freelist, but there's no indication that the freelist is protected from
prematurely deleting things at all. Perhaps the library is using DCAS somehow
to ensure that deleted nodes are never dereferenced.

~~~
ah-
While reading the rather hilarious blog of his, I stumbled upon this possible
explanation why that sentence is gone:

 _I 'm going to ditch LL/SC implementations, in part because they're just too
unreliable and in part because they prevent the library from being able to
simply offer the caller a choice - "garbage collection or not?" which in turn
removes a TON of stuff which otherwise has to be explained to the end user._

[http://www.liblfds.org/blog/index.php?entry=Quick-
update](http://www.liblfds.org/blog/index.php?entry=Quick-update)

------
lfds-admin
Hej. I am the author. I understand there are a range of simple and well
understood licenses, such as the MIT license, which can be used. However, this
implies the I agree with and abide by the notion of licensing as it exists
today. This is not quite the case. I think property rights are correct, but I
think freedom (all contracts must be voluntary and well-informed, except in
self-defence) is correct, and so the situation as it stands, where other
people decide the law regarding licensing _and we have no choice but to adhere
to it_ , this is unethical.

Be clear here - it is not so much the _purpose_ of licensing which I disagree
with (for it fairly closely implements property rights, which I profoundly
agree with) but rather the method of implementation - there is a single set of
law, decided by others, and we have to obey that law. This violates my idea of
freedom.

So with regard to the licensing text on the library, I am attempting to meet
the legal needs of users by giving them a carte blanche; they can _know_ their
(reasonable, sane) licensing needs will be met, and this I hope simply removes
the issue as far as they are concerned, while honouring my ethical views.

~~~
nine_k
It's sort of like not to check the values of parameters passed to a function,
expecting than only reasonable, sane values will be provided, and no one will
try to exploit the function.

This may be a fine assumption for a private function. But for a public
interface, be it a function or a license, you have to program defensively.

------
jedbrown
Why choose this over Concurrency Kit
([http://concurrencykit.org/](http://concurrencykit.org/))?

~~~
jedisct1
+1. Concurrencykit is awesome and really well-maintained.

~~~
MordodeMaru
Both look good. See if we can support them in biicode.

------
cbd1984
If it's distributed without a license, it's illegal to redistribute the
software, or to distribute modified copies. You can only distribute patch kits
which can be applied to the original codebase, which everyone must acquire
from the original developers.

[http://cr.yp.to/softwarelaw.html](http://cr.yp.to/softwarelaw.html)

> Once you've legally downloaded a program, you can compile it. You can run
> it. You can modify it. You can distribute your patches for other people to
> use.

... and that's it.

~~~
cbd1984
I read the page:

> You are free to use this software in any way, for any purpose.

This is a license. It can't possibly be anything else. It's a simple,
permissive license, but it's a license. Them claiming it isn't a license is
nonsense.

~~~
anon3_
Is public domain a _license_ , or is it no license?

I'm wondering the same thing.

~~~
cbd1984
> Is public domain a license, or is it no license?

Public domain means nobody owns the copyright to that work. Anyone can use it
for any purpose whatsoever, because there's nobody to tell them they can't.

So, no, it's not a license. It's putting something in a category where a
license wouldn't even make sense.

------
lfds-admin
To answer various questions people have asked and to make one or two notes of
my own;

1\. The current version of the library contains a profound design flaw - it
allocates memory. This is not viable in any way. The next release (which is
very close to completion, but has been deferred for the last month due to a
crisis project at work) does not. Regarding ConcurrencyKit, it is an excellent
project, and I know Samy (I was involved in him getting his last job); he is
an excellent programmer. He said to me about four years ago I needed to make a
new release :-)

2\. Regarding ABA and memory reclaimation. There is a comment noting that it
is hard to find this information in the docs. I apologise. It is indeed not
particularly explained. The docs were written with a view to a non-lock-free
informed user wishing to use the API, so technical information regarding the
internal implementation is lacking. In the current release ABA is resolved by
the use of DCAS (limiting the library to ARM and Intel), and there is no
memory reclaimation. In the next release, memory reclaimation has been
implemented (removing the limit of ARM and Intel). I also implemented on ARM
LL/SC versions of the algorithms, but these have been removed, because it's
too hard to know which platforms they will or will not work on. ARM is still
supported of course, but by using LL/SC to emulate CAS.

3\. The blog, ah, yes. It's where I let off steam in the heat of frustration,
which is off course not always pleasent - however, it's nice to vent. I am
thinking of getting rid of it though, because it's not very professional.

4\. The reason for a new github repo on each release, and the naming strategy,
is to permit the concurrent use of multiple releases of the library. By
allowing a new release to be used in parallel with old releases, existing code
does not have to be modified. This minimizes work and risk. For minor releases
and bug releases, where APIs do not change, a global search and replace will
permit a full change to the new version.

5\. Regarding frames. The site uses a number of third-party applications, such
as a forum and a blog. These all emit HTML which assumes they are generating
the whole page - they have a <HTML> tag in their output. Their output then has
to exist in a frame. If I capture it and send it to a DIV, the DIV renders
incorrectly.

Finally, please note the forum (which is fairly new) needs to be upgraded to
reduce spam attacks (I've been too busy to do so). Currently I see hundreds of
attempts each day, by robots, to generate accounts and so it is impractical to
continually scan the lists of requests to find any real requests. The forum
does now offer a captch for this, and as soon as I get time (one or two weeks)
I will upgrade to this.

~~~
bhouston
> The reason for a new github repo on each release, and the naming strategy,
> is to permit the concurrent use of multiple releases of the library. By
> allowing a new release to be used in parallel with old releases, existing
> code does not have to be modified. This minimizes work and risk. For minor
> releases and bug releases, where APIs do not change, a global search and
> replace will permit a full change to the new version.

You can just have multiple branches in a single github repo. :) That is what
most people do.

~~~
rr56
I wanted to ask you if tags on a mian dev branch, wouldn't be enough, but I
guess the reason for branches is the ability to port back some changes etc.?

------
rdtsc
I am using this. Has been working well for years in a low latency environment.
Great stuff.

------
bhouston
Looks interesting.

Funny thing I sort of judge projects now by being on github and looking at
issues and PRs to see quality and health of the project -- I really would like
to get a sense of the number of bugs and the issues people are running into
while using it.

Thus an independently hosted project like this is thus hard to for me to
objectively judge.

------
jvoorhis
The blog is amusing..

~~~
laichzeit0
It's like the prelude to an early heart attack.

------
anon3_
Why show off about 7.0 when there is none?

Where is the VCS?

~~~
michaelmior
Good question. The GitHub account is odd. There appears to be a new repository
for each release.

[https://github.com/liblfds?tab=repositories](https://github.com/liblfds?tab=repositories)

~~~
anon3_
With all due respect, frames on the website? Creating a new repo for version
releases? I would like an explanation from the author.

Many people judge books by their cover - I say let's see the code. But
superficial things like that do matter in people's perceptions.

edit: below, frames.

~~~
michaelmior
I assume you mean frames and not iframes.

------
zaszrespawned
This guys blog is hilarious~!

