Subject:
[ruby-ffi] Re: How to copy a struct?
From:
Wayne Meissner
Date:
10/29/11 6:57 PM
To:
ruby-ffi@googlegroups.com



On Sunday, 30 October 2011 02:31:12 UTC+10, cootcraig wrote:

For this task I plan to have multiple threads, each reading from a
network socket.  I will struct.new a buffer for each thread, the dll
call reads into the struct, the struct is used read only in any
threads that reference it. No need for dup with this approach.


Yep, that will work fine.  As long as only one thread mutates a struct at a time,  they should be safe to share between threads in that manner.