[prev in list] [next in list] [prev in thread] [next in thread] 

List:       boost-users
Subject:    Re: [Boost-users] boost asio
From:       "Sharma, Nishant via Boost-users" <boost-users () lists ! boost ! org>
Date:       2017-10-23 8:22:02
Message-ID: 31f5f14de5ed41df8511b194e46a2827 () SVR-IES-MBX-03 ! mgc ! mentorg ! com
[Download RAW message or body]

Hi Frederic,
I did not understand your comment...
My point was that I do a cond wait before I call async(read|write)
From within the callback function, I do a notify so that the next async command can \
be executed. Will this not result in same functionality as you mentioned where wait \
is done after calling async(read|write) ?

Best Regards,
Nishant Sharma

-----Original Message-----
From: Frédéric [mailto:ufospoke@gmail.com] 
Sent: Saturday, October 21, 2017 12:42 PM
To: Sharma, Nishant <Nishant_Sharma@mentor.com>
Cc: boost-users@lists.boost.org
Subject: Re: [Boost-users] boost asio

> I got it.. Just one more point..
> You mentioned:
> after you call asyn_write/read, you wait until done==true and in your call back \
> function, you acquire the mutex, done == true, then notify_all().

> Should this wait be not done before we call sync read/write?
> OR
> Is it that we do it after calling async read/write so that threads can do their I/O \
> work and the actual callback  functions are called sequentially?

wait right after otherwise, you will never call async_(read|write).

> Should we use interprocess_mutex and interprocess_condition instead or normal mutex \
> and condition since different clients and the server will run in different \
> processes ?

std::mutex and std::condition_variable are just fine.

F
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
https://lists.boost.org/mailman/listinfo.cgi/boost-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic