gem5-users@gem5.org

The gem5 Users mailing list

View all threads

Hi does gem5 Ruby support pthreads lock and unlock

SC
Srikanta Chaitanya
Thu, Jun 29, 2023 7:03 AM

Hi ,
I am running pthreads matmul program for riscv in se mode , but with lock
and unlock instructions I am getting read error in Ruby ..
Do i have to compile with mthreads ..

Thanks
Chaitanya

Hi , I am running pthreads matmul program for riscv in se mode , but with lock and unlock instructions I am getting read error in Ruby .. Do i have to compile with mthreads .. Thanks Chaitanya
VS
Víctor Soria
Thu, Jun 29, 2023 8:41 AM

Hi Srikanta,

In the past, I've been able to run pthreads mutex with ruby using Arm
and FS mode. By default, pthreads use syscalls to the OS to sleep or
wake up threads. As far as I know, FS does not work with RISCV.
Therefore, you could try to select the pthread mutex type to spinlock to
avoid having sleeps and wakes up from the OS. Notice that if you set
spinlock, you should never instantiate more threads than cores
(oversuscription). Otherwise you can have temporal deadlocks and starvation.

Regards,

Víctor.

On 29/6/23 9:03, Srikanta Chaitanya via gem5-users wrote:

Hi ,
I am running pthreads matmul program for riscv in se mode , but with
lock and unlock instructions I am getting read error in Ruby ..
Do i have to compile with mthreads ..

Thanks
Chaitanya


gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-leave@gem5.org

Hi Srikanta, In the past, I've been able to run pthreads mutex with ruby using Arm and FS mode. By default, pthreads use syscalls to the OS to sleep or wake up threads. As far as I know, FS does not work with RISCV. Therefore, you could try to select the pthread mutex type to spinlock to avoid having sleeps and wakes up from the OS. Notice that if you set spinlock, you should never instantiate more threads than cores (oversuscription). Otherwise you can have temporal deadlocks and starvation. Regards, Víctor. On 29/6/23 9:03, Srikanta Chaitanya via gem5-users wrote: > Hi , > I am running pthreads matmul program for riscv in se mode , but with > lock and unlock instructions I am getting read error in Ruby .. > Do i have to compile with mthreads .. > > Thanks > Chaitanya > > _______________________________________________ > gem5-users mailing list -- gem5-users@gem5.org > To unsubscribe send an email to gem5-users-leave@gem5.org
SC
Srikanta Chaitanya
Thu, Jun 29, 2023 11:02 AM

Thanks for the reply.

On Thu, Jun 29, 2023, 2:11 PM Víctor Soria victor.soria@bsc.es wrote:

Hi Srikanta,

In the past, I've been able to run pthreads mutex with ruby using Arm
and FS mode. By default, pthreads use syscalls to the OS to sleep or
wake up threads. As far as I know, FS does not work with RISCV.
Therefore, you could try to select the pthread mutex type to spinlock to
avoid having sleeps and wakes up from the OS. Notice that if you set
spinlock, you should never instantiate more threads than cores
(oversuscription). Otherwise you can have temporal deadlocks and
starvation.

Regards,

Víctor.

On 29/6/23 9:03, Srikanta Chaitanya via gem5-users wrote:

Hi ,
I am running pthreads matmul program for riscv in se mode , but with
lock and unlock instructions I am getting read error in Ruby ..
Do i have to compile with mthreads ..

Thanks
Chaitanya


gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-leave@gem5.org

Thanks for the reply. On Thu, Jun 29, 2023, 2:11 PM Víctor Soria <victor.soria@bsc.es> wrote: > Hi Srikanta, > > In the past, I've been able to run pthreads mutex with ruby using Arm > and FS mode. By default, pthreads use syscalls to the OS to sleep or > wake up threads. As far as I know, FS does not work with RISCV. > Therefore, you could try to select the pthread mutex type to spinlock to > avoid having sleeps and wakes up from the OS. Notice that if you set > spinlock, you should never instantiate more threads than cores > (oversuscription). Otherwise you can have temporal deadlocks and > starvation. > > Regards, > > Víctor. > > On 29/6/23 9:03, Srikanta Chaitanya via gem5-users wrote: > > Hi , > > I am running pthreads matmul program for riscv in se mode , but with > > lock and unlock instructions I am getting read error in Ruby .. > > Do i have to compile with mthreads .. > > > > Thanks > > Chaitanya > > > > _______________________________________________ > > gem5-users mailing list -- gem5-users@gem5.org > > To unsubscribe send an email to gem5-users-leave@gem5.org >
JL
Jason Lowe-Power
Thu, Jun 29, 2023 4:37 PM

Full system mode is fully supported for RISC-V. There should not be any
problems with running pthreads on RISC-V.

(Side note: There could be a small bug in the RISC-V atomic instructions...
we're looking into it, but haven't been able to track it down.)

Cheers,
Jason

On Thu, Jun 29, 2023 at 4:05 AM Srikanta Chaitanya via gem5-users <
gem5-users@gem5.org> wrote:

Thanks for the reply.

On Thu, Jun 29, 2023, 2:11 PM Víctor Soria victor.soria@bsc.es wrote:

Hi Srikanta,

In the past, I've been able to run pthreads mutex with ruby using Arm
and FS mode. By default, pthreads use syscalls to the OS to sleep or
wake up threads. As far as I know, FS does not work with RISCV.
Therefore, you could try to select the pthread mutex type to spinlock to
avoid having sleeps and wakes up from the OS. Notice that if you set
spinlock, you should never instantiate more threads than cores
(oversuscription). Otherwise you can have temporal deadlocks and
starvation.

Regards,

Víctor.

On 29/6/23 9:03, Srikanta Chaitanya via gem5-users wrote:

Hi ,
I am running pthreads matmul program for riscv in se mode , but with
lock and unlock instructions I am getting read error in Ruby ..
Do i have to compile with mthreads ..

Thanks
Chaitanya


gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-leave@gem5.org


gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-leave@gem5.org

Full system mode is fully supported for RISC-V. There should not be any problems with running pthreads on RISC-V. (Side note: There could be a small bug in the RISC-V atomic instructions... we're looking into it, but haven't been able to track it down.) Cheers, Jason On Thu, Jun 29, 2023 at 4:05 AM Srikanta Chaitanya via gem5-users < gem5-users@gem5.org> wrote: > Thanks for the reply. > > On Thu, Jun 29, 2023, 2:11 PM Víctor Soria <victor.soria@bsc.es> wrote: > >> Hi Srikanta, >> >> In the past, I've been able to run pthreads mutex with ruby using Arm >> and FS mode. By default, pthreads use syscalls to the OS to sleep or >> wake up threads. As far as I know, FS does not work with RISCV. >> Therefore, you could try to select the pthread mutex type to spinlock to >> avoid having sleeps and wakes up from the OS. Notice that if you set >> spinlock, you should never instantiate more threads than cores >> (oversuscription). Otherwise you can have temporal deadlocks and >> starvation. >> >> Regards, >> >> Víctor. >> >> On 29/6/23 9:03, Srikanta Chaitanya via gem5-users wrote: >> > Hi , >> > I am running pthreads matmul program for riscv in se mode , but with >> > lock and unlock instructions I am getting read error in Ruby .. >> > Do i have to compile with mthreads .. >> > >> > Thanks >> > Chaitanya >> > >> > _______________________________________________ >> > gem5-users mailing list -- gem5-users@gem5.org >> > To unsubscribe send an email to gem5-users-leave@gem5.org >> > _______________________________________________ > gem5-users mailing list -- gem5-users@gem5.org > To unsubscribe send an email to gem5-users-leave@gem5.org >
SC
Srikanta Chaitanya
Thu, Jun 29, 2023 6:05 PM

Thanks for the update.

On Thu, Jun 29, 2023, 10:08 PM Jason Lowe-Power jason@lowepower.com wrote:

Full system mode is fully supported for RISC-V. There should not be any
problems with running pthreads on RISC-V.

(Side note: There could be a small bug in the RISC-V atomic
instructions... we're looking into it, but haven't been able to track it
down.)

Cheers,
Jason

On Thu, Jun 29, 2023 at 4:05 AM Srikanta Chaitanya via gem5-users <
gem5-users@gem5.org> wrote:

Thanks for the reply.

On Thu, Jun 29, 2023, 2:11 PM Víctor Soria victor.soria@bsc.es wrote:

Hi Srikanta,

In the past, I've been able to run pthreads mutex with ruby using Arm
and FS mode. By default, pthreads use syscalls to the OS to sleep or
wake up threads. As far as I know, FS does not work with RISCV.
Therefore, you could try to select the pthread mutex type to spinlock to
avoid having sleeps and wakes up from the OS. Notice that if you set
spinlock, you should never instantiate more threads than cores
(oversuscription). Otherwise you can have temporal deadlocks and
starvation.

Regards,

Víctor.

On 29/6/23 9:03, Srikanta Chaitanya via gem5-users wrote:

Hi ,
I am running pthreads matmul program for riscv in se mode , but with
lock and unlock instructions I am getting read error in Ruby ..
Do i have to compile with mthreads ..

Thanks
Chaitanya


gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-leave@gem5.org


gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-leave@gem5.org

Thanks for the update. On Thu, Jun 29, 2023, 10:08 PM Jason Lowe-Power <jason@lowepower.com> wrote: > Full system mode is fully supported for RISC-V. There should not be any > problems with running pthreads on RISC-V. > > (Side note: There could be a small bug in the RISC-V atomic > instructions... we're looking into it, but haven't been able to track it > down.) > > Cheers, > Jason > > On Thu, Jun 29, 2023 at 4:05 AM Srikanta Chaitanya via gem5-users < > gem5-users@gem5.org> wrote: > >> Thanks for the reply. >> >> On Thu, Jun 29, 2023, 2:11 PM Víctor Soria <victor.soria@bsc.es> wrote: >> >>> Hi Srikanta, >>> >>> In the past, I've been able to run pthreads mutex with ruby using Arm >>> and FS mode. By default, pthreads use syscalls to the OS to sleep or >>> wake up threads. As far as I know, FS does not work with RISCV. >>> Therefore, you could try to select the pthread mutex type to spinlock to >>> avoid having sleeps and wakes up from the OS. Notice that if you set >>> spinlock, you should never instantiate more threads than cores >>> (oversuscription). Otherwise you can have temporal deadlocks and >>> starvation. >>> >>> Regards, >>> >>> Víctor. >>> >>> On 29/6/23 9:03, Srikanta Chaitanya via gem5-users wrote: >>> > Hi , >>> > I am running pthreads matmul program for riscv in se mode , but with >>> > lock and unlock instructions I am getting read error in Ruby .. >>> > Do i have to compile with mthreads .. >>> > >>> > Thanks >>> > Chaitanya >>> > >>> > _______________________________________________ >>> > gem5-users mailing list -- gem5-users@gem5.org >>> > To unsubscribe send an email to gem5-users-leave@gem5.org >>> >> _______________________________________________ >> gem5-users mailing list -- gem5-users@gem5.org >> To unsubscribe send an email to gem5-users-leave@gem5.org >> >