-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 As Sylvain said, produce() actually means "hey, I'm finished with producing these items, so do what you want in another block (ie. in another thread", so obviously, the things like nitems_written must reflect this.
On 11/25/2014 07:42 AM, Mostafa Alizadeh wrote: > On Mon, Nov 24, 2014 at 4:11 PM, Sylvain Munaut <[email protected]> > wrote: > >>> Please help me find the rational reason! >> >> Because calling "produce" means, "I'm done, go ahead and take >> those sample". Don't call it until you are reall done ... >> >> GR is a multi-threaded applications, each work() function is >> executed in different threads and as soon as you call produce(), >> other threads are signalled that the samples are ready. >> >> >> Cheers, >> >> Sylvain >> > > > Hi Sylvain, > > I infer from what you said that what I see is true and logical! In > another word, the nitems_written can be updated permanently in the > middle of the work's routine. OK > > But I still think that this is not logical to update the number of > items written before returning from work call. > > Thank you, Mostafa > > > > _______________________________________________ Discuss-gnuradio > mailing list [email protected] > https://lists.gnu.org/mailman/listinfo/discuss-gnuradio > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUdDu+AAoJEAFxB7BbsDrL/ZoH/jhy/Mqgfe6EyU2gA1fId11o fi9CMUYGd0n0vbqgqHap4+qYbDeKdFNk81jp2KgOyqPC8Al/JPlVQJNX3QwFW+w3 O4a1hMqHbGIf9ktP45kpuQH/PgH1yMJD805IueJYjxBqrU2VDXTuGr9P8dqfbfz9 xCrbkHMDLIV0eJEiZ67d3U3ldFUj1XSYBsPRdpAs+hnsmsfmyUB6fJHGxucil1DW o6a0FxU4dZvAfdcjSUTkz2Kq8N9NUekPcMfBeTDDZqMctdDUtv0+Ggr8cqZ++uHd SqscQLEbS8XXnTrSEXb3PLij/wz2f+4AZFkPlzRDc/0R4jHiCdW/E1lpkWznwtQ= =N8Wx -----END PGP SIGNATURE----- _______________________________________________ Discuss-gnuradio mailing list [email protected] https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
