Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposed fix for issue #182 Thread safety #261

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

f20
Copy link

@f20 f20 commented Oct 28, 2020

This pull request provides a test for multi-threaded workbook creation, code modifications to enable the test to pass, updated POD documentation, and an example script demonstrating multi-threaded workbook creation.

@f20 f20 mentioned this pull request Oct 28, 2020
@f20 f20 force-pushed the master branch 2 times, most recently from cdf83f5 to 0c8eea7 Compare October 29, 2020 11:32
@shawnlaffan
Copy link

This PR might still need some work as File::Path::rmdir does not work well under threads on recent Windows perls.

On Strawberry Perl 5.38.2.2 I get the warnings below, and the temp dirs are not cleaned up.

A fallback to File::Path::Tiny might work. I know it has been discussed in #182 but local testing shows it cleans up the temp dirs when run under threads.

See also discussion under StrawberryPerl/Perl-Dist-Strawberry#146

prove -b t\regression\multithreaded01.t
t\regression\multithreaded01.t .. cannot remove directory for C:/Users/user/AppData/Local/Temp/1RQIu8NVJb: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 6.
cannot remove directory for C:/Users/user/AppData/Local/Temp/l6CVhPK03r: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 6.
cannot remove directory for C:/Users/user/AppData/Local/Temp/dBdC1ivKbm: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 6.
cannot remove directory for C:/Users/user/AppData/Local/Temp/QNb4K5D6_0: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 6.
cannot remove directory for C:/Users/user/AppData/Local/Temp/NAjHivjNbc: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 6.
cannot remove directory for C:/Users/user/AppData/Local/Temp/nj6SpjY1gw: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 6.
cannot remove directory for C:/Users/user/AppData/Local/Temp/APXPvXE6MW: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 6.
cannot remove directory for C:/Users/user/AppData/Local/Temp/_Qdc80JNQu: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 2.
cannot remove directory for C:/Users/user/AppData/Local/Temp/oWM8vXJXP0: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 2.
cannot remove directory for C:/Users/user/AppData/Local/Temp/LdeWEEQqB1: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 2.
cannot remove directory for C:/Users/user/AppData/Local/Temp/8y9naxYdrU: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 2.
cannot remove directory for C:/Users/user/AppData/Local/Temp/aVgMQeKit5: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 2.
cannot remove directory for C:/Users/user/AppData/Local/Temp/Zd0oN4Rck4: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 2.
cannot remove directory for C:/Users/user/AppData/Local/Temp/vhrKIEgxLc: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 2.
cannot remove directory for C:/Users/user/AppData/Local/Temp/Dm2Gu2_CpE: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 5.
cannot remove directory for C:/Users/user/AppData/Local/Temp/FLdkJPD2H9: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 5.
cannot remove directory for C:/Users/user/AppData/Local/Temp/kg5ooXrV0_: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 5.
cannot remove directory for C:/Users/user/AppData/Local/Temp/adjxT3yjzR: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 5.
cannot remove directory for C:/Users/user/AppData/Local/Temp/13W7hYDERj: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 5.
cannot remove directory for C:/Users/user/AppData/Local/Temp/fdIDlQUOj0: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 5.
cannot remove directory for C:/Users/user/AppData/Local/Temp/dpQ5Ds4FXQ: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 5.
cannot remove directory for C:/Users/user/AppData/Local/Temp/cLi_jcwNvD: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 3.
cannot remove directory for C:/Users/user/AppData/Local/Temp/58iAPR1gco: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 3.
cannot remove directory for C:/Users/user/AppData/Local/Temp/AzAoW3jSFH: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 3.
cannot remove directory for C:/Users/user/AppData/Local/Temp/2JegrTh_YZ: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 3.
cannot remove directory for C:/Users/user/AppData/Local/Temp/VYDJKfEUYb: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 3.
cannot remove directory for C:/Users/user/AppData/Local/Temp/SjonnP9Qe0: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 3.
cannot remove directory for C:/Users/user/AppData/Local/Temp/cq03TZExvS: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 3.
cannot remove directory for C:/Users/user/AppData/Local/Temp/SOfiBP29hh: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 4.
cannot remove directory for C:/Users/user/AppData/Local/Temp/HdbNJfPgp8: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 4.
cannot remove directory for C:/Users/user/AppData/Local/Temp/yUPS_J7NLp: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 4.
cannot remove directory for C:/Users/user/AppData/Local/Temp/FnKYg2rIXq: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 4.
cannot remove directory for C:/Users/user/AppData/Local/Temp/DEYzOqMVz6: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 4.
cannot remove directory for C:/Users/user/AppData/Local/Temp/eLRJunxzlT: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 4.
cannot remove directory for C:/Users/user/AppData/Local/Temp/F1h9BeTpsb: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 4.
cannot remove directory for C:/Users/user/AppData/Local/Temp/4wnIuBZitY: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 1.
cannot remove directory for C:/Users/user/AppData/Local/Temp/4arKdhu8tg: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 1.
cannot remove directory for C:/Users/user/AppData/Local/Temp/YQtjVwiCp6: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 1.
cannot remove directory for C:/Users/user/AppData/Local/Temp/ZT_JEsLgrg: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 1.
cannot remove directory for C:/Users/user/AppData/Local/Temp/AG5YLIbUub: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 1.
cannot remove directory for C:/Users/user/AppData/Local/Temp/Twn_Zunm6q: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 1.
cannot remove directory for C:/Users/user/AppData/Local/Temp/fwpW2oGrH_: Directory not empty at C:/perls/5.38.2.2_PDL/perl/lib/File/Temp.pm line 2643 thread 1.
t\regression\multithreaded01.t .. ok
All tests successful.
Files=1, Tests=42,  1 wallclock secs ( 0.06 usr +  0.01 sys =  0.08 CPU)
Result: PASS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants