You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Bruce Mitchener (JIRA)" <ji...@apache.org> on 2011/01/31 19:28:29 UTC

[jira] Commented: (AVRO-746) Atomic reference counts

    [ https://issues.apache.org/jira/browse/AVRO-746?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12988832#comment-12988832 ] 

Bruce Mitchener commented on AVRO-746:
--------------------------------------

I'd like to see more / wider discussion of this.

1) Portability: Will this work on Windows as set up now via CMake?
2) New external code...
3) Performance hit in single-threaded case?
4) Portability: iOS / Android impact?

Also, the CMake integration here doesn't build any code, it just uses the headers, I'm guessing that's okay?

And this piles on top of some other stuff that uses C99 struct initializers ... I have another patch that I've been working on that gets rid of those because they don't work in Visual Studio which will now conflict with this.

> Atomic reference counts
> -----------------------
>
>                 Key: AVRO-746
>                 URL: https://issues.apache.org/jira/browse/AVRO-746
>             Project: Avro
>          Issue Type: Bug
>          Components: c
>            Reporter: Douglas Creager
>            Assignee: Douglas Creager
>         Attachments: 0001-Atomic-reference-counts.patch, fixed-make-dist.patch
>
>
> In one of my projects that uses Avro, I pass avro_datum_t instances between threads, using the reference count mechanism to make sure that they're not freed while any thread still has a reference to them.  I was getting some spurious segfaults, which were caused by the fact that the reference counts aren't updated atomically.  I've created a patch that implements atomic reference counts, using the [OpenPA library|http://trac.mcs.anl.gov/projects/openpa/] to provide the atomic operations themselves.  (That library is MIT licensed, so it can be included in the source tree.)
> Note that only avro_XXX_incref and avro_XXX_decref are thread-safe as a result of this patch.  For all of the other library functions, the caller is still responsible for ensuring thread safety.
> The patch makes sure that the OpenPA code works in both the old autotools build and the newer CMake build.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira