Hace 9 años | Por gallir
Publicado hace 9 años por gallir

Probado y ya funciona. Gracias.

Pido una favor para los que tenéis Raspeberry 2 u otro cacharro ARM con varios núcleos (y compilador instalado), es para asegurarme que un código en ensamblador funciona correctamente en ARM con multiprocesador (es para el libro https://gallir.wordpress.com/principios-de-concurrencia/)

El código está en https://github.com/gallir/concurrencia_source_samples/tree/master/arm (un .c, un .s y el Makefile).

Sólo tenéis que hacer make y generará el ejecutable. Luego quiero que lo probéis varias veces, debe salir algo como:

./stack_llsc_freelist
3 malloc
2 malloc
1 malloc
0 malloc
End 1
End 3
End 2
End 0

El orden no importa, no deben salir más de cuatro malloc (es posible que salga alguno menos). Tampoco debería salir ningún mensaje de cola vacía o de errores de punteros. Como es un tema de concurrencia, la probabilidad que salga es baja, por eso mejor probarlo varias veces (o si trasteáis con el código, aumentarle el número de OPERATIONS en el .c).

Si me podéis dar los tiempos mejor, en mi Raspberry 1 (no tengo la dos todavía, por eso pido ayuda) sale lo siguiente:

$ time ./stack_llsc_freelist
3 malloc
2 malloc
1 malloc
0 malloc
End 3
End 0
End 1
End 2

real0m3.623s
user0m3.540s
sys0m0.000s

Muchas gracias.

PS: Acababa de poner lo mismo en https://plus.google.com/+RicardoGalliGranada/posts/fX8z7jtg84S y me avisan de esto https://twitter.com/Phoenix_Alx/status/571769535910567937 ;)

Comentarios

D

lo del tiempo como se puede mirar?

gallir

#1

$ time ./comando

En este caso

$ time ./stack_llsc_freelist

(está en la entradilla)

¿te va siempre bien?

sinconexion

#8 Son 2, fallo mio al mirar lol

gallir

#14 Estás haciendo bien, pero ya no sé qué mirar, debo esperar a tener una a mano para saber exactamente por dónde falla

Muchas gracias.

gallir

#5 Que mi código está fallando, tendré que intentar adivinar dónde y pedirte que pruebes otra vez

D

#7 Parece que en una banana Pi si va...mira los comentarios

editado:
Pues parece que era solo un núceo el otro comentario... Bueno tu envía y probaré

gallir

#14 Bueno, hay otra versión si quieres probar Muchas gracias.

D

#18 Error in 2 it shouldn't be empty
3 malloc
2 malloc
Error in 2 it shouldn't be empty
2 malloc
Error in 0 it shouldn't be empty
Error in 0 it shouldn't be empty
0 malloc
Error in 3 it shouldn't be empty
Error in 2 it shouldn't be empty
3 malloc
3 malloc
1 malloc
2 malloc
Error in 0 it shouldn't be empty
Error in 0 it shouldn't be empty
3 malloc
Error in 2 it shouldn't be empty
2 malloc
3 malloc
Error in 0 it shouldn't be empty
0 malloc
3 malloc
3 malloc
2 malloc
2 malloc
Error in 2 it shouldn't be empty
2 malloc
Error in 0 it shouldn't be empty
0 malloc
Error in 2 it shouldn't be empty
2 malloc
Error in 3 it shouldn't be empty
3 malloc
3 malloc
Error in 2 it shouldn't be empty
2 malloc
3 malloc
0 malloc
Error in 2 it shouldn't be empty
3 malloc
Error in 0 it shouldn't be empty
0 malloc
Error in 0 it shouldn't be empty
0 malloc
3 malloc
2 malloc
Error in 3 it shouldn't be empty
3 malloc
Error in 0 it shouldn't be empty
Error in 3 it shouldn't be empty
3 malloc
Error in 2 it shouldn't be empty
2 malloc
0 malloc
3 malloc
Error in 0 it shouldn't be empty
0 malloc
Error in 3 it shouldn't be empty
0 malloc
Error in 2 it shouldn't be empty
2 malloc
2 malloc
2 malloc
2 malloc
Error in 3 it shouldn't be empty
2 malloc
Error in 0 it shouldn't be empty
0 malloc
0 malloc
Error in 3 it shouldn't be empty
3 malloc
3 malloc
3 malloc
2 malloc
Error in 2 it shouldn't be empty
3 malloc
Error in 3 it shouldn't be empty
3 malloc
0 malloc
Error in 0 it shouldn't be empty
0 malloc
0 malloc
Error in 2 it shouldn't be empty
0 malloc
2 malloc
Error in 0 it shouldn't be empty
0 malloc
0 malloc
0 malloc
Error in 2 it shouldn't be empty
3 malloc
2 malloc
Error in 3 it shouldn't be empty
0 malloc
Error in 2 it shouldn't be empty
Error in 2 it shouldn't be empty
2 malloc
2 malloc
0 malloc
2 malloc
1 malloc
Error in 0 it shouldn't be empty
0 malloc
1 malloc
3 malloc
0 malloc
Error in 3 it shouldn't be empty
0 malloc
Error in 1 it shouldn't be empty
1 malloc
Error in 0 it shouldn't be empty
0 malloc
3 malloc
Error in 3 it shouldn't be empty
3 malloc
3 malloc
Error in 0 it shouldn't be empty
0 malloc
Error in 1 it shouldn't be empty
1 malloc
3 malloc
0 malloc
Error in 1 it shouldn't be empty
1 malloc
1 malloc
Error in 3 it shouldn't be empty
3 malloc
Error in 3 it shouldn't be empty
0 malloc
Error in 0 it shouldn't be empty
0 malloc
Error in 1 it shouldn't be empty
1 malloc
0 malloc
0 malloc
Error in 1 it shouldn't be empty
1 malloc
Error in 1 it shouldn't be empty
1 malloc
1 malloc
Error in 0 it shouldn't be empty
3 malloc
Error in 3 it shouldn't be empty
3 malloc
0 malloc
0 malloc
3 malloc
Error in 0 it shouldn't be empty
0 malloc
2 malloc
Error in 2 it shouldn't be empty
2 malloc
1 malloc
Error in 0 it shouldn't be empty
0 malloc
End 1
End 3
End 0
End 2

real 0m3.116s
user 0m10.940s
sys 0m0.110s


the same

gallir

#19 Subí otra versión, ya me han dicho que funciona correctamente en un ARM con varios núcleos. ¿Podrías verificar cuando puedas y tengas ganas? Gracias

D

#22 Tachaaaan

1 malloc
0 malloc
2 malloc
3 malloc
End 3
End 2
End 1
End 0

real 0m3.178s
user 0m12.610s
sys 0m0.010s

gallir

#23 Bieeeeeeeeeeennnnnnnnnnnnnnnnnnnnnnnnnnn!

Muchas gracias

gallir

#15 Tengo Raspberry, lo que no tengo es la 2, con multiprocesador, que no hay stock.

Y no sé qué haces en un sub para estas cosas si consideras que es spam. Hay que aguantar a cada uno.

R

#16 no te lo tomes a mal, pero es que verte pidiendo estas cosas aquí es "ridículo".

Mirate cualquier cubie o placa similar, hay stock de sobra y te sirve para lo que quieres mejor que esperar a que alguien te compile y ejecute el código.

pkreuzt

#20 #0 Pero no una Raspi2 hombre, que eso esta obsoleto XD cc/@whizzo

D

Las ayudas se hacen en masculino, y los favores en femenino. Me parece troleada.

D

espera la imagen que te he puesto es el de esta mañana que pusiste...la nueva versión si me suelta problemas.


Lineas finales, pero más o menos igual

Error in 1 it shouldn't be empty
1 malloc
2 malloc
3 malloc
1 malloc
Error in 3 it shouldn't be empty
3 malloc
3 malloc
2 malloc
Error in 2 it shouldn't be empty
3 malloc
1 malloc
1 malloc
3 malloc
2 malloc
1 malloc
Error in 2 it shouldn't be empty
2 malloc
2 malloc
Error in 1 it shouldn't be empty
3 malloc
Error in 3 it shouldn't be empty
1 malloc
End 2
End 1
End 3
End 0

real 0m2.354s
user 0m5.500s
sys 0m0.600s

gallir

#3 Eso es mala noticia

Tendré que comprarme una urgente para probar

D

#4 Por ? ¿Qué significa? uso raspbian y está actualizado

gallir

#3 Ya actualicé los ficheros, ¿podrías probar otra vez, cuando puedas?

D

#11 pues lo mismo de antes
Error in 1 it shouldn't be empty
2 malloc
2 malloc
Error in 1 it shouldn't be empty
Error in 3 it shouldn't be empty
Error in 3 it shouldn't be empty
Error in 3 it shouldn't be empty
Error in 3 it shouldn't be empty
Error in 2 it shouldn't be empty
1 malloc
Error in 1 it shouldn't be empty
Error in 2 it shouldn't be empty
Error in 1 it shouldn't be empty
1 malloc
3 malloc
3 malloc
2 malloc
2 malloc
Error in 3 it shouldn't be empty
Error in 1 it shouldn't be empty
3 malloc
Error in 3 it shouldn't be empty
3 malloc
3 malloc
2 malloc
Error in 2 it shouldn't be empty
Error in 3 it shouldn't be empty
Error in 1 it shouldn't be empty
End 2
End 0
End 3
End 1

real 0m2.798s
user 0m6.060s
sys 0m0.860s

gallir

#12 Ya subí otra versión, cuando puedas (esto de programar concurrencia en ensamblador y por suposición es duro )

D

#13 Error in 2 it shouldn't be empty
Error in 0 it shouldn't be empty
Error in 2 it shouldn't be empty
Error in 2 it shouldn't be empty
Error in 2 it shouldn't be empty
3 malloc
Error in 3 it shouldn't be empty
Error in 3 it shouldn't be empty
2 malloc
Error in 2 it shouldn't be empty
3 malloc
Error in 3 it shouldn't be empty
3 malloc
3 malloc
Error in 0 it shouldn't be empty
0 malloc
2 malloc
2 malloc
Error in 3 it shouldn't be empty
3 malloc
Error in 0 it shouldn't be empty
0 malloc
Error in 3 it shouldn't be empty
2 malloc
Error in 0 it shouldn't be empty
2 malloc
Error in 0 it shouldn't be empty
0 malloc
0 malloc
Error in 3 it shouldn't be empty
3 malloc
0 malloc
3 malloc
Error in 2 it shouldn't be empty
Error in 0 it shouldn't be empty
3 malloc
Error in 3 it shouldn't be empty
3 malloc
2 malloc
0 malloc
Error in 3 it shouldn't be empty
2 malloc
3 malloc
2 malloc
Error in 0 it shouldn't be empty
2 malloc
Error in 3 it shouldn't be empty
0 malloc
Error in 0 it shouldn't be empty
3 malloc
Error in 3 it shouldn't be empty
0 malloc
Error in 0 it shouldn't be empty
3 malloc
Error in 2 it shouldn't be empty
3 malloc
Error in 3 it shouldn't be empty
3 malloc
Error in 0 it shouldn't be empty
3 malloc
Error in 0 it shouldn't be empty
0 malloc
Error in 0 it shouldn't be empty
2 malloc
Error in 3 it shouldn't be empty
2 malloc
Error in 3 it shouldn't be empty
Error in 0 it shouldn't be empty
Error in 2 it shouldn't be empty
Error in 2 it shouldn't be empty
3 malloc
Error in 3 it shouldn't be empty
Error in 2 it shouldn't be empty
3 malloc
3 malloc
Error in 2 it shouldn't be empty
2 malloc
Error in 0 it shouldn't be empty
Error in 3 it shouldn't be empty
0 malloc
Error in 3 it shouldn't be empty
3 malloc
2 malloc
Error in 0 it shouldn't be empty
Error in 3 it shouldn't be empty
0 malloc
Error in 3 it shouldn't be empty
0 malloc
Error in 0 it shouldn't be empty
Error in 2 it shouldn't be empty
2 malloc
Error in 0 it shouldn't be empty
Error in 0 it shouldn't be empty
Error in 3 it shouldn't be empty
0 malloc
3 malloc
Error in 2 it shouldn't be empty
0 malloc
Error in 3 it shouldn't be empty
0 malloc
End 2
End 3
End 0

real 0m2.719s
user 0m5.910s
sys 0m0.960s




¿Puede ser que esté haciendo algo mal yo?

hago make y ya ta

R

#13 vaya manera de spamear, anuncia el libro con un baner. No me puedo creer que no tengas un pi a mano o una cubieboard.

Iba a darte una shell en una placa, pero casi mejor que pidas un pi que te irá mejor. Ahora aparte, habrá servidores con ARM muy serios.

Cyberbob

Como molaría tener a este hombre de ministro o al menos asesor en TIC.....

sinconexion

En una Banana Pi con ARM Cortex-A7 Dual-core (ARMv7-A) 1 GHz todo bien parece

0 malloc
1 malloc
0 malloc
0 malloc
End 0
End 1
End 2
End 3

real0m2.686s
user0m3.880s
sys0m0.180s

OPERATIONS x10

0 malloc
1 malloc
2 malloc
3 malloc
End 2
End 1
End 3
End 0

real0m27.132s
user0m38.680s
sys0m1.820s

El tiempo no es muy indicativo porque está ejecutando varias cosas más.

sinconexion

#6 cat /proc/cpuinfo

Processor: ARMv7 Processor rev 4 (v7l)
processor: 0
BogoMIPS: 2004.17

processor: 1
BogoMIPS: 2011.05

Features: swp half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt
CPU implementer: 0x41
CPU architecture: 7
CPU variant: 0x0
CPU part: 0xc07
CPU revision: 4

Hardware: sun7i
Revision: 0000