mercredi 30 décembre 2015

Best way to implement or use CallBack function

I am facing an issue with callback mechanism which I use to pass data from my library to client. What client does is sometime in the callback function they do some time consuming processing. Which blocks the callback function. Like if client tries to close my library from my callback function I get deadlock because I can't close the library unless I close the thread which is used by the callback function.

Is there any standard to using the callback? Like any design pattern that dictates how a callback should be implemented by a library or used by a client.

Aucun commentaire:

Enregistrer un commentaire