ChanServ changed the topic of #lowempire to: Low Level Empire | This channel was created for Algorithms, Compilers, OS, Hardware, CS theory stuff (low-level) | be patient, polite | don't do off top | Ask your question | Paste your codes/long texts https://paste.debian.net/ or "echo just testing! | nc termbin.com 9999" | Logs: https://freenode.irclog.whitequark.org/lowempire
xdxdxd has quit [Ping timeout: 264 seconds]
_whitelogger has joined #lowempire
ChanServ changed the topic of #lowempire to: Low Level Empire | This channel was created for Algorithms, Compilers, OS, Hardware, CS theory stuff (low-level) | be patient, polite | don't do off top | Ask your question | Paste your codes/long texts https://paste.debian.net/ or "echo just testing! | nc termbin.com 9999" | Logs: https://freenode.irclog.whitequark.org/lowempire
<marlin>
indi biz diger kodlari analiz eliyirik, veziyeti izah eliyim sene yoxsa ozun oxuyursan?
<dumenci>
oxuyuram birdeq
<marlin>
xeyirli olsun webcameran ))
<dumenci>
bu daniel iledi problem?
<marlin>
indi tema bilrisen nedir async client-le sync olan client sohebtdir. Sync olan client icine aync yaziblar ve hemin funksiylarda blocking call bas verir oda event loopu blocklayir
<marlin>
mende bu xiyarlara deyirem ki sizin o sync clientler hec birisi fully async env vermirde, ona gore el verisli deyil.
<marlin>
sync olan call -lar ucun basqa thread-de cixmalidir ki main thread hasniki event loopun threadini dagitmasin
<dumenci>
sen
<dumenci>
her actioni
<dumenci>
ayri threadda
<dumenci>
async ile yazmisan?
<marlin>
yox yox mellim
<dumenci>
Updating my answer: only publish, unsubscribe methods are used in separate threads because there were blocking calls. Which would have blocked the main thread and prevented the event loop from running.
<marlin>
her sey main thread-de bas verir bir thread-de gedir
<dumenci>
burda ele yazmisan axi
<dumenci>
her metod
<dumenci>
seperate threads yazmisan
<marlin>
ama iki method var ki onlari ayrica thread-de gedir
<dumenci>
aha
<marlin>
he yanliz iki method ucun
<dumenci>
he onu deyirem ele
<dumenci>
publish ve unsubscribe ayri threadlardadir
<dumenci>
ki bir birilerini bloklamasinlar
<marlin>
he ama onu bele olmagin nezere alib yazmimsam ki block
<marlin>
olmasin ayssagol
<marlin>
duz elemisem de ?
<dumenci>
birdene
<dumenci>
mesele varda
<dumenci>
her thread ayrica event loop yaradir beyem?
<dumenci>
yoxsa sen pythonda elnen yaradirsan?
<dumenci>
threadlarin icinde?
<marlin>
yox mellim gozde kodla izah edim sene
<dumenci>
aha
<dumenci>
@danieljfarrell Updating my answer: only publish, unsubscribe methods are used in separate threads because there were blocking calls. Which would have blocked the main thread and prevented the event loop from running.
<dumenci>
bax burda yazmisan ki
<dumenci>
ayri threadlardadi
<dumenci>
publish ve unsubcribe
<dumenci>
duzdur?
<dumenci>
ve onlar ucun
<dumenci>
ayrica event loop yaradirsan
<dumenci>
ki ikisi bir event loopu istifade etmesin
<dumenci>
duzdu?
<marlin>
bax bele izah eliyim sene, corotunie objectler hamsi bir event loopun icinde olurda duzdur, hamsi bir loopun icinde olurlar. ona gore asyncio oz documentation da deyir ki eger blocking call varsa her hansi onu run_in_executer methodu ile basqa threadle cixsin. ama o ayrica event loop yaratmir. sadece main thread-e qarismir yeni corotunie olanlara mane olmur. T
<marlin>
men orda run_in_executer methodu nu istifade edirem
<dumenci>
event loopu prosto
<dumenci>
polling ucun istifade
<marlin>
oda ozu executer qbul edir, hansiki o executer bir basqa threaddir
<dumenci>
edirler
<marlin>
run_in_executor()
<dumenci>
onsuzda
<dumenci>
her bir halda
<dumenci>
polling olanda
<marlin>
aha
<dumenci>
event looplar dayanmalidir
<dumenci>
sorry threadlar
<marlin>
ayasagol
<dumenci>
yadaki hansisa async actionlar
<marlin>
yeni event loop bize butun corotunie leri yeni hovuza yigmaq ucun lazimdir-da
<marlin>
ve context swtitchinle bir corotunie object-den o birine kecsin asynchronous olsun deye
<dumenci>
he
<dumenci>
event loop birdenedir
<dumenci>
ancaq ferqli ferqli
<dumenci>
threadlarin
<dumenci>
stateini bloklayir
<dumenci>
cunki onlari ferqli ferqli contextler kimi gorur
<dumenci>
bloklayir deyende switching edir
<dumenci>
aralarinda
<dumenci>
o contextlerin
<marlin>
threadler-de duzdur?
<dumenci>
heee
<marlin>
aha indi men bu yanasmasni dark-la etmisik eslinde
<dumenci>
threadin icindeki async
<dumenci>
birdeq zeng gelir mene
<marlin>
yaxsi
<marlin>
indi tema bilirsen nedir, bu deyil tam olaraq. bu xiyarlar mene deyir ki orda diger library-ler hansiki sync kodu fully implment edibler async-e mende onlara izah elemey calisiram ki bu asgida gosterlen library ler tam full deyil iclerinde blocking call-lar var. hansiki event loop corotunie object yox blocking call gedir
<marlin>
he birinci olan example-dir orda blocking call-lar bu xiyar deyirdki o example olan library hansiki paho implement edib event loop sohbetini
<dumenci>
:-D
<dumenci>
@sabuhish I've not used paho in async mode yet. But there should be support for async mode as well. At least there is connect_async() and examples/loop_asyncio.py.
<marlin>
:D
<dumenci>
bu elebilir ki
<dumenci>
sen deyirsenki
<dumenci>
async mode islemir
<dumenci>
sen ise deyirsen ki async olsa bele
<dumenci>
blocking var
<marlin>
yox mellim
<dumenci>
nese men tutmuram temani :-d
<dumenci>
etaga
<dumenci>
nece yox sohbet bududa :-D
<dumenci>
aybrat
<marlin>
bax paho adinda library var bu deyirki men paho library-sin async mode -da isletmemsiem
<dumenci>
hede
<marlin>
ona gore bilmirem :)
<dumenci>
bu deyirki
<dumenci>
bu ele basha dusur ki
<dumenci>
sen deirsenki
<dumenci>
async modeda islemir
<dumenci>
ona gore deir
<dumenci>
isletmemisem
<dumenci>
bilmirem
<dumenci>
sen ise deirsenki
<dumenci>
async mode var
<dumenci>
ancaq
<dumenci>
blocking var
<dumenci>
duzdur
<dumenci>
?
<dumenci>
publish ve unsubcribe independent islediyine gore
<marlin>
yes
<marlin>
yes
<dumenci>
indi men sene
<dumenci>
birdene sey deyim :-D
<dumenci>
sen paylasdigin kod
<marlin>
publish ve unsubcribe independent islediyine gore bunu saxal
<dumenci>
exampledir axi
<dumenci>
sen ona baxirsan
<dumenci>
deirsenki
<dumenci>
burda blocking var?
<marlin>
he o example paho terefinden yazilib bunu o qaqas paylasib
<dumenci>
o exampledir axi
<marlin>
mende ona baxib deyirem ki
<dumenci>
onsuzda o examplei
<dumenci>
kimdi istifade eden
<dumenci>
ona gore bunlar
<marlin>
he eaxmple-dir
<dumenci>
diresibde
<dumenci>
istifade etmek isteyen
<dumenci>
goturub yaza bilerde
<dumenci>
non-blocking
<dumenci>
publish ve unsubcribe metodu yeginki bu modulun icinde var
<marlin>
bu example atib mene gostermek isteyirki bax bunlar yaziblarda example islyirde yeni ))
<dumenci>
:-D
<dumenci>
esh yoxe
<marlin>
gic elinde qalmisam indi ikinci temaya qayidim
<marlin>
buda ki basdan ayaga catasrifoya ve complicated birseydir, burda coxlu blocking var
<marlin>
he eynen duz deyirsen
<dumenci>
birnece gun
<dumenci>
sebr et
<dumenci>
brat
<dumenci>
biryerde
<dumenci>
asynci
<dumenci>
coroutinelari
<dumenci>
futurelari
<dumenci>
zadi
<dumenci>
hamisini
<dumenci>
0dan yazacayiq
<marlin>
ve axrinci atdgimi baxsan qaqas goturub kopyayilib 1 inci atdigim example bu module icine
<marlin>
:d
<marlin>
:d pis olmazdi bunlari cavab yazim men yagli bassinlar icine xiyar yiginlari))
<dumenci>
yox cavab yazma
<dumenci>
siz ayri ayri temalardan danisirsiz :-D
<dumenci>
yazma kod pisdir flan
<marlin>
yoxe ay brat niyeki
<marlin>
yox qeiteyen ele yazmaram :) etik deyil axi
<marlin>
o
<marlin>
I've not used paho in async mode yet. But there should be support for async mode as well.
<dumenci>
hee pedantic olmaq lazimdir deyil.
<dumenci>
he bunu
<dumenci>
gordum
<dumenci>
bu ele basa dusub ki
<dumenci>
sen deirsenki
<marlin>
bu xiyar deyir ki men istfiade elememisem -de istfiade elemeisen ne atdirisan topic-de ))
<dumenci>
async mode yoxdur
<dumenci>
:-D
<marlin>
sen deyirsen ele basa dusub ? :d
<dumenci>
bes yazdigina baxda :-D
<dumenci>
deyir ki async mode istifade etmemisem hele
<marlin>
Thank you too. Well, gmqtt library was one of the successful library among others for being an async client for MQTT. It has been updated till now, other libraries did not follow up latest development. Library that fully implements the MQTT protocol MQTTv311 and MQTTv50. Library paho is not async client which would not be good case f
<dumenci>
ancaq async mode ucun support olmalidir
<marlin>
hee
<marlin>
o menim axricni cumleme ilisib
<marlin>
sen demis))
<dumenci>
Library paho is not async client which would not be good case
<dumenci>
aaa
<dumenci>
bunlar bashqa sey deyire :-D
<marlin>
bu menim cavabim idi mellim indi tutdun ))
<dumenci>
basha dusdum
<dumenci>
sen demisen ki
<dumenci>
async client deyil
<marlin>
aha eynen
<marlin>
ona gore duzgun handle olunmaycaqdi emeliyatlar
<dumenci>
Use in conjunction with loop_start() to connect in a non-blocking manner. The connection will not complete until loop_start() is called.
<dumenci>
o iki ayri thread publish metodunu istiffade ede bilerde
<marlin>
yox bax men install eledim library funksionllagin istifade edirem, orda teyin olunan call -lar hamsi blocking-dirse men onlari nece non-blcoking ede bilerim ki/?
<dumenci>
publish funksiyasi vare
<marlin>
hede onda ayyri ayric thread-ler yaratmis olursan da mellim
<marlin>
aha
<dumenci>
publish funksiyasini sen async metodla yaza bilersende
<marlin>
menim ki wrapperdir burdaki birdene clientin ustunde
<marlin>
o clientin becnmarklardiri
<dumenci>
bu ancaq clientler ucundur?
<dumenci>
he okay
<marlin>
aha
<marlin>
sen temani basa dusdun yoxsa yox ?) umumi mvzgi deyim sene
<dumenci>
hee
<dumenci>
basha dusmusem :-D
<dumenci>
senin clientivin benchmark neticesi burda yuksekdir
<dumenci>
pahodan?
<marlin>
paho ile berarberdir
<marlin>
yanasidr
<dumenci>
he onda basin burax :-D
<marlin>
birinde bir yuksekdir
<marlin>
birinde o biri
<marlin>
ortada deyek
<dumenci>
senin yazdigin
<dumenci>
wrapperde
<dumenci>
affect ede biler
<dumenci>
performansi
<dumenci>
ister paho ucun ve yaxud o biriler ucun
<dumenci>
belke onun yazdigi wrapper optimal olmayib
<marlin>
bu o sohbet deyil prosta bax bunun deidyie
<dumenci>
bildime
<dumenci>
bu onu benchmark etmek ucun
<marlin>
i think it's a difficult problem, to integrate the event loop with an existing non-async library. I see various attempts at asyncio + MQTT, with varying levels of success. Take a look here https://pypi.org/project/asyncio-mqtt/ and at the list of similar projects at the bottom. Maybe one of them might already have what you need?
<dumenci>
wrapper yazibda
<marlin>
o wrapper yazmayib axi brat sehv salirsan :)
<dumenci>
bes benchmarki nece edib? :-D
<marlin>
men yazmisam duz deyirsen mende ola bielr ))
<xdxdxd>
blyat cox heyecanlaniram, dumenciye neyise izah eliriy :DDDDxaxaxaxa
<dumenci>
ahahaha :-D niye ? :-D
<xdxdxd>
qaqaw burda bawa duwmemeli ne var e,cox sade weydi ))) xaxaxaxaxaxa
<dumenci>
ahahah
<xdxdxd>
Rust-da da beledide)))) xaxaxaxax
<dumenci>
-basha duse bilmiremde :-D
<xdxdxd>
xaxaxaxaxaxax
<dumenci>
men basha dusmuseme zarafatsiz
<xdxdxd>
siz deweloper yigini haminiz belesiz onsda
<dumenci>
marlin prosto
<dumenci>
nese basqa tema deir etaga
<dumenci>
onu tuta bilmemisem :-D
<xdxdxd>
o bu deyqe nese yazir etaga,indi bir datsan mesaj gelecey))) )taniyiram onu ))))xaxaxaxa
<marlin>
pahonu yaziblarda mellimler ama bunu yazanda python 2.7 idi o vaxtlar hele async gelmemisdi. onlar butun kitabaxanni sirf sync kode uygun olaraq yaziblar. ve hal hazirda kitabxana butovlikle hec bir sekilde async detseklemir. ve diger paho ustunde olan kitabxana yazanlar gotruub bu pahonu ustunden async client yaziblar ve iceride neqder blocking call-lar var. men bunu izah elemeye calisiram ki bu neqder bele duzdur? biz yazdigimiz ise gmqtt hansiki asyn
<marlin>
kitabxanadir mqtt ucun. bizim kitabxanimiz bu gmqtt istifade eliyerik connection yaradir ama aync olaraq.
<marlin>
oxumusam kodu sadece ama run edib bele strese salmamimisq
<dumenci>
sen mene ata bilersen?
<dumenci>
harda gormusen
<marlin>
aha gozle
<dumenci>
blocking hisselerini
<marlin>
bu hissede coxdure bax biz oxuya oxuya gedirik , yuxairdan basalasan bax goressen ki adi stantdart gedir. ve kitabxana daxilinde olan methodlar hansiki onlar hamsi blockingdir, onlari non-blocking olan funckisyalrin icinde cagirir
<dumenci>
ve yaxud memoryde emeliyyat gedende bash vere bilmez axi
xdxdxd has quit [Ping timeout: 256 seconds]
<marlin>
bele summurize etsek bize bu tip blocking veya non blocking olmasi yanliz networka qosulma zamani, connection zamani, file oxuyan zaman daha cox lazim olur diger hallarda o qderde ehemiyet kesb elemir he?
<dumenci>
CSI is defined as a variable width, point to point, packet-based interface implemented as two uni-directional links with low-voltage differential signaling. A full width CSI link is physically configured with 20 bit lanes in each direction; these bit lanes are divided into four quadrants of 5 bit lanes, as depicted in Figure 1 [25]. While most CSI links are full width, half width (2 quadrants) and quarter width (a single quadrant) options are
<dumenci>
also possible. Reduced width links will likely be used for connecting MPUs and chipset components. Additionally, some CSI ports can be bifurcated, so that they can connect to two different agents (for example, so that an I/O hub can directly connect to two different MPUs) [25]. The width of the link determines the physical unit of information transfer, or phit, which can be 5, 10 or 20 bits.
<dumenci>
Non-RAM IO bound like disk, network: ps aux, then check if CPU% / 100 < n threads. If yes, you are IO bound, e.g. blocking reads are just waiting for data and the scheduler is skipping that process. Then use further tools like sudo iotop to decide which IO is the problem exactly.
<marlin>
cunki CPU emeliyatlarina onsuzda menasizdir da sen asinxronzesin qoyasan, I/O -da laizm olur cox vaxtdir
<xdxdxd>
mellim onda bele cixir python bir pox elemirde burda hamsin cpu ozu handle elir? ya nece? pythonun bir rolu varki burda?
<dumenci>
yox
<dumenci>
bunu qarisdirma
<dumenci>
bu basqa seydir
<dumenci>
bu CPU ucundur
<dumenci>
bunun asynce
<dumenci>
elaqesi yoxdur
<dumenci>
async basqa seydir
<xdxdxd>
aaa okay
<dumenci>
bu prosto CPU seviyyesinde bas verir
<dumenci>
CPUnun ona gorede asynce ehtiyyaci yoxdur
<dumenci>
ve async olada bilmez cpuda
<dumenci>
ancaq I/O device-larda ola biler
<dumenci>
CPU ozu birnovu asynci ozu edir
<dumenci>
bos qalan resurslari istifade edir
dark_paket has joined #lowempire
<dumenci>
sende bunu I/O devicelar ucun edirsen
<dumenci>
I/O deviceinnan melumat gelene qedfer
<dumenci>
qeder
<dumenci>
basqa islerini gore bilersen
<xdxdxd>
I/O devicler bele deyek bu funksionalliga malik olmadigina gore onu kod seviyyesinde implementatsiya elirsende he?
<dark_paket>
salam ehali
<xdxdxd>
hi man
<marlin>
xello my friend
<dumenci>
eynen
<dumenci>
hallo
<xdxdxd>
ele bilki kodnan OS-e deyirsenki bu devicden cavab gelene kimi kec bu biri kodlarimi icra ele
<dark_paket>
mellim async imkani python 2.7-de var idi?
<marlin>
3.4 de gelib deyesne
<xdxdxd>
siwdida duz sobetin ortasina :DDD
<dumenci>
mence yox
<marlin>
:D :D gullu tuman sohbeti)
<xdxdxd>
python2-de tasklar ve coroutinler olub
<xdxdxd>
amma kod seviyyesinde async olmuyub
<marlin>
bes ona geder onda I/O emeliyatlar schedule olunmuirdu?
<dumenci>
pythondaki
<dumenci>
coroutinelara
<dumenci>
men
<dumenci>
6 il bunnan qabaq baxmisam
<dumenci>
axrinci defe :-D
<dumenci>
onnan evvel
<dumenci>
birbasha epoll zad istifade edirdiler
<xdxdxd>
olunurdu marlin yield from istifade elirdiler
<dumenci>
select zad var idi
<marlin>
epoll nedir tam olaraq?
<dumenci>
epoll bu async zad
<dumenci>
vare
<dumenci>
onlarin atasi :-D
<dumenci>
hamisi epollu istifade edir
<dumenci>
axirda
<dumenci>
event polling
<marlin>
aa
<dumenci>
bes men size hemise danisirdim axi bunlari
<dumenci>
qulaq asmamisiz deyesen :-D
<dumenci>
epoll is similar to FreeBSD's kqueue, in that it consists of a set of user-space functions, each taking a file descriptor argument denoting the configurable kernel object, against which they cooperatively operate. epoll uses a red-black tree (RB-tree) data structure to keep track of all file descriptors that are currently being monitored.[3]
<xdxdxd>
mellim senin dediylerivi biz 1 aydan sora hezm eliye biliriy))))
<dumenci>
indi linux kernelde
<dumenci>
birdenede
<marlin>
mellim qulaq asiriq bax yuxaridan yazdigin hamsi senin nece illerdi eziyetin behresidir inidi bize rahatlasdirirsan cox sagol :) ama bizdeki caisiqiri basa dusek sen dedikce note alaq oyrenek ola biler unudairq zad cunki terminler bize yaddir bezen senin kimi tam deep otrua bilmirik
<marlin>
aa ela
<dumenci>
birdq gelirem
<marlin>
mende computerimle gedim su goturum
<dark_paket>
kokunde asynci meselesin select modulu durur?
<xdxdxd>
bele doc-a baxiramki he)
<marlin>
herseyi eden bu epolldur
<nodee>
Ozde her sistemde ferqlidiye, bu nedi ala
<nodee>
Marlin fileno zad var, yadiva duwur?? Bugun baxdigimiz kodda sock.fileno() cagirirdi qaqash
<marlin>
he nese ele birsey var idi
<marlin>
o read zad elemeyi deyirsen he?
<dumenci>
geldim usaglar
<marlin>
ondan elave lucid dediyi kimi read zad var idi
<dumenci>
mende asynci shushaya impelemt edecem :-D
<dumenci>
implement :-D
<marlin>
shusha nedir?
<marlin>
shushadir onu adi
<dumenci>
heee
<dumenci>
shusha deyil?
<marlin>
deyismisdin axi diyesenn
<dumenci>
yox hele deyismemisem
<marlin>
neyse :)
<marlin>
ora implment etsen
<marlin>
belke birge baxaq bizde
<marlin>
:)
<marlin>
maraqli olardi ozumuz yazsaq en azindan dediklierin theroikleri praktiki olaraq gorerdik
<marlin>
men basa dusmurem sen bu qder bilik savad gezen elmdire adam
<dumenci>
demek yuxarini
<dumenci>
oxdum
<dumenci>
yox
<dumenci>
asyncin
<dumenci>
arxasinda
<dumenci>
select
<dumenci>
epoll
<dumenci>
dayanmir
<dumenci>
python interpreterdir
<dumenci>
ona gorede
<dumenci>
asynci custom ozleri yaziblar
<dumenci>
elebil kernelin gorduyu isi
<dumenci>
bunlar cpythonda edirler
<dumenci>
eslinde bu seyin arxasinda
<dumenci>
cox boyuk texnologiyalar dayanir
<xdxdxd>
alem deydiye bir birine
<xdxdxd>
bes bu epool select nenir?
<dumenci>
epoll ve select
<dumenci>
kernelin verdiyi
<dumenci>
funksionalligdir
<dumenci>
python evveller onu istfiade
<dumenci>
edirdiler
<dumenci>
pythonda
<dumenci>
cunki async yox idi
<dumenci>
sonra asynci custom ozleri yazdilar
<xdxdxd>
kernelin verdiyi funksionalliq deyende, yeni async ucun verdiyi?
<dumenci>
cpythonda
<dumenci>
aha
<dumenci>
eynen
<dumenci>
kernel asinxronization ucun
<dumenci>
verir bu funksionalligi
<xdxdxd>
aaa yeni bir basha kernel seviyyesinde call elirdiler?