You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "arturobernalg (via GitHub)" <gi...@apache.org> on 2023/07/27 16:21:44 UTC

[GitHub] [httpcomponents-core] arturobernalg opened a new pull request, #412: HTTPCORE-746 - Refactor Synchronized Blocks to Use ReentrantLock.

arturobernalg opened a new pull request, #412:
URL: https://github.com/apache/httpcomponents-core/pull/412

   Title: Refactor Synchronized Blocks to Use ReentrantLock 
   
   
   This commit replaces instances of 'synchronized' keyword with the explicit use of 'ReentrantLock' to provide more advanced synchronization mechanisms. 
   
   Changes include:
   - Replaced 'synchronized' methods with methods that use a 'ReentrantLock' for managing state.
   - Modified methods to use the 'lock' and 'unlock' methods of 'ReentrantLock' to ensure safe execution of critical sections.
   
   
   These changes provide more granular control over locks, fair locking behavior, and the ability to interrupt thread waiting for a lock or timeout if a lock cannot be obtained immediately.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] [httpcomponents-core] garydgregory commented on pull request #412: HTTPCORE-746 - Refactor Synchronized Blocks to Use ReentrantLock.

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on PR #412:
URL: https://github.com/apache/httpcomponents-core/pull/412#issuecomment-1672895900

   Hi all,
   I expressed by general concern here: https://github.com/apache/httpcomponents-client/pull/474#issuecomment-1672890856
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] [httpcomponents-core] ok2c commented on pull request #412: HTTPCORE-746 - Refactor Synchronized Blocks to Use ReentrantLock.

Posted by "ok2c (via GitHub)" <gi...@apache.org>.
ok2c commented on PR #412:
URL: https://github.com/apache/httpcomponents-core/pull/412#issuecomment-1672641700

   @arturobernalg The change-set looks good to me. The question here is whether we should commit it to 5.3.x or master. Given that 5.3 may take a long time to get to GA, I think we should apply this change to master and release it with a patch release.
   @michael-o @garydgregory @rschmitt  What is your take?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] [httpcomponents-core] michael-o commented on pull request #412: HTTPCORE-746 - Refactor Synchronized Blocks to Use ReentrantLock.

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on PR #412:
URL: https://github.com/apache/httpcomponents-core/pull/412#issuecomment-1672691512

   > @arturobernalg The change-set looks good to me. The question here is whether we should commit it to 5.3.x or master. Given that 5.3 may take a long time to get to GA, I think we should apply this change to master and release it with a patch release. @michael-o @garydgregory @rschmitt What is your take?
   
   For me, this is clearly 5.3.x only although the change is equivalent. I am just being overprecatious because concurrent bugs are very hard to tackle.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] [httpcomponents-core] ok2c commented on pull request #412: HTTPCORE-746 - Refactor Synchronized Blocks to Use ReentrantLock.

Posted by "ok2c (via GitHub)" <gi...@apache.org>.
ok2c commented on PR #412:
URL: https://github.com/apache/httpcomponents-core/pull/412#issuecomment-1656589460

   @arturobernalg This is a major change with potential pitfalls and side-effects. For instance, one must be super-careful when synchronizing on an object which is not an internal instance variable. I will take me a while to review the change-set properly.  


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] [httpcomponents-core] garydgregory commented on pull request #412: HTTPCORE-746 - Refactor Synchronized Blocks to Use ReentrantLock.

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on PR #412:
URL: https://github.com/apache/httpcomponents-core/pull/412#issuecomment-1674618499

   Ok, sounds good.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] [httpcomponents-core] ok2c commented on pull request #412: HTTPCORE-746 - Refactor Synchronized Blocks to Use ReentrantLock.

Posted by "ok2c (via GitHub)" <gi...@apache.org>.
ok2c commented on PR #412:
URL: https://github.com/apache/httpcomponents-core/pull/412#issuecomment-1674557972

   @arturobernalg Please go ahead and merge this PR. @garydgregory I hope your concerns have been addressed by extending the 5.3 development cycle. It should give us ample of time to test out the changes.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] [httpcomponents-core] arturobernalg merged pull request #412: HTTPCORE-746 - Refactor Synchronized Blocks to Use ReentrantLock.

Posted by "arturobernalg (via GitHub)" <gi...@apache.org>.
arturobernalg merged PR #412:
URL: https://github.com/apache/httpcomponents-core/pull/412


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org