Multiple instance of libvpx in threaded environment

74 views
Skip to first unread message

Rahul Ganure

unread,
Apr 13, 2012, 10:16:33 AM4/13/12
to WebM Discussion
Hello all,

I have a situation where i have to create multiple instance of libvpx
encoder and decoder with multiple threads to run these instances.

My question is will I face any probelms due to creation of multiple
instances of vp8 encoder and decoder in threaded environment (using
different threads) because of global structures and variables use in
libvpx.

Any help will be greatly appreciated.
Regards,
Rahul Ganure.

John Koleszar

unread,
Apr 13, 2012, 11:02:19 AM4/13/12
to webm-d...@webmproject.org
The code is multi-instance safe, you shouldn't have a problem.

> --
> You received this message because you are subscribed to the Google Groups "WebM Discussion" group.
> To post to this group, send email to webm-d...@webmproject.org.
> To unsubscribe from this group, send email to webm-discuss...@webmproject.org.
> For more options, visit this group at http://groups.google.com/a/webmproject.org/group/webm-discuss/?hl=en.
>

vinod

unread,
Apr 14, 2012, 8:05:50 AM4/14/12
to WebM Discussion
Hi John Koleszar thanks for your reply.

The code is multi-instance safe but whether it is multi-threaded safe?
That is in our application we are in a situation to create the
multiple instances in multiple threads, Hence If we try to call the
encoder instances in different threads, some times the
vpx_codec_get_cx_data() returning the NULL pointer. Our doubt is since
there many global variables, whenever different threads try to access
these variables simultaneously what could happen?.

As per our tests, Only encoder is found to giving random crashing and
results when we call from different threads. But decoder is found to
proper even with multiple instance in multiple threads. Also we are
suspecting Decoder also may give problem in case of multi
threads(though no problems have been found form our tests)

Any help will be greatly appreciated.

Regards,
Vinod and Rahul.

On Apr 13, 8:02 pm, John Koleszar <jkoles...@google.com> wrote:
> The code is multi-instance safe, you shouldn't have a problem.
>
>
>
>
>
>
>
> On Fri, Apr 13, 2012 at 7:16 AM, Rahul Ganure <rahul50...@gmail.com> wrote:
> > Hello all,
>
> > I have a situation where i have to create multiple instance of libvpx
> > encoder and decoder with multiple threads to run these instances.
>
> > My question is will I face any probelms due to creation of multiple
> > instances of vp8 encoder and decoder in threaded environment (using
> > different threads) because of global structures and variables use in
> > libvpx.
>
> > Any help will be greatly appreciated.
> > Regards,
> > Rahul Ganure.
>
> > --
> > You received this message because you are subscribed to the Google Groups "WebM Discussion" group.
> > To post to this group, send email to webm-disc...@webmproject.org.
> > To unsubscribe from this group, send email to webm-discuss+unsubscr...@webmproject.org.

John Koleszar

unread,
Apr 14, 2012, 12:22:07 PM4/14/12
to webm-d...@webmproject.org
Both the encoder and decoder should be multi-instance multi-thread
safe. You can have multiple threads accessing multiple encoders at the
same time. What you can't do is have two different threads access the
same encoder at the same time. If you want to have one thread call
vpx_codec_encode() and anther call vpx_codec_get_cx_data() or mutliple
threads calling encode() you need to provide your own synchronization.

I'm aware of other people using the codec in this configuration
successfully, but if you have a reproducible test case that crashes
the codec and you're adhering to the one thread per instance
restriction I mentioned, I'd like to look at it.

> To post to this group, send email to webm-d...@webmproject.org.
> To unsubscribe from this group, send email to webm-discuss...@webmproject.org.

Reply all
Reply to author
Forward
0 new messages