in reply to Need Help in threading perl

Does the problem happen without threads?

You did not output $branchfile in your error message. Output $branchfile in your error message and inspect if the file already exists at the location and if the current user can create files there.

Replies are listed 'Best First'.
Re^2: Need Help in threading perl
by sachin raj aryan (Sexton) on Jul 31, 2024 at 10:34 UTC

    currently the max thread is 3 , so it only making 3 txt file. when i increase number of thread to 10 , it makes 10 files and then fails.

Re^2: Need Help in threading perl
by sachin raj aryan (Sexton) on Jul 31, 2024 at 10:40 UTC

    threadccod_new.pl: open : Permission denied at threadccod_new.pl line 75. <\p> Iam not sure why getting permission for 4th and so on file and not for 1st to third file .

      You are using chdir from within a thread. I would avoid that, since it is never clear between operating systems, whether the "current directory" is per-thread or global per program.

      Also, replace

      system "mkdir $branchdir";

      with mkdir:

      mkdir $branchdir;

      Also, output the filename and path in your error message. I already suggested that to you but you ignore it. Please explain why you ignore my advice.

        I din;t ignored i posted same in earlier meesage Thread 1 terminated abnormally: threadccod_new.pl: open /home/sbi/Desktop/SRA/CCOD_TEST: fileneme is Z_CCOD_00327.txt$! at threadccod_new.pl line 77.

Re^2: Need Help in threading perl
by sachin raj aryan (Sexton) on Jul 31, 2024 at 10:31 UTC

    No