I wanted to create a hangout for this, but running a bit out of time,so a
quick reply here:

2014-09-24 19:35 GMT+02:00 Liwei Peng <[email protected]>:

> Hi,
>
> I am creating a new output plugin. I am using message batching and multiple
> worker queue instances. I have a question on how rsyslog handles
> multi-threading.
>
> Question: will rsyslog design make sure the 'BeginTransaction/DoAction n
> times/EndTransaction' is thread safe? so that for each worker instance,
> doAction, beginTransaction, endTransaction will never be called at the same
> time? Thanks.
>

Exactly. The need to be reentrant-safe, though. Because they may get called
concurrently for *different* worker instances. For new code, it is
preferable to use commitTransaction -- see ./tools/omfile.c for an example.


> The following is the related doc. I am not sure what the 'entry point'
> means, is it at function level, or at
> beginTransaction/doAction/EndTransaction level?
>
>
> From this link:
> http://www.rsyslog.com/doc/master/development/dev_oplugins.html, about
> threading:
>

That doc needs some upgrading for v8, but in essence it's right.

HTH
Rainer

>
> However, a plugin’s entry points are guaranteed to be never called
> concurrently *for the same action*. That means your plugin must be able to
> be called concurrently by two or more threads, but you can be sure that for
> the same instance no concurrent calls happen.

_______________________________________________
> rsyslog mailing list
> http://lists.adiscon.net/mailman/listinfo/rsyslog
> http://www.rsyslog.com/professional-services/
> What's up with rsyslog? Follow https://twitter.com/rgerhards
> NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad
> of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you
> DON'T LIKE THAT.
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of 
sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE 
THAT.

Reply via email to