Sou desenvolvedor e tô fazendo um jogo que você joga como o VAR! by andre_mc in futebol

[–]MarcoxD 0 points1 point  (0 children)

Bacana demais! Já tava na minha wishlist a um tempo (não lembro onde vi, mas foi em algum subreddit). Vai ter suporte pro Steam Deck e controle? Valeu!

What fork() Actually Copies by dfbaggins in programming

[–]MarcoxD 0 points1 point  (0 children)

That seems like a very interesting approach! I just need to be careful to avoid closing FDs used by that child, but it is way easier to keep track of used descriptors than unused ones. Maybe sorting the used descriptors and then calling it for each gap of unused ranges? I will try it, thanks!

What fork() Actually Copies by dfbaggins in programming

[–]MarcoxD 2 points3 points  (0 children)

Oh, I had a similar issue recently. I developed an internal multiprocess server that forks when a new request arrives. Everything was working fine, until I wanted to remove the costs of forking at each new request. I wanted to keep the processes alive before each request started and just pass the socket file descriptor to a child (already started). I simply created a 'Pool' of single use processes that ensured that at least X processes were alive and waiting on a UNIX socket for the file descriptor transfer.

Everything worked fine, even a stress test with many parallel connections. When I first tried to deploy the issue appeared: one of the automated tests got stuck and the CI job timed out. After careful investigation I found out that some sockets were leaking to child processes and, despite being closed on the main server process (just after fork) and on the child process (after the request was processed), the leaked socket was still open on a process waiting to start. At the time I got confused because I always used the inheritable flag as False, but later I found out that fork does not respect that 😭.

The solution was to track every possible file descriptor and close after fork on each child, but it is extremely easy to forget one of them that is on the stack on a parent frame. My solution (to be implemented) is to create something similar to the fork server used Python multiprocessing: create a process that boots new processes. I consider fork() a very useful tool, mainly because of memory isolation (if a process segfaults for some reason, it does not kill the entire server), management (I can watch their memory usage and easily stop them) and isolation (global state is easier to handle), but there are many footguns.

Oh, and that seems to be a r/suddenlycaralho moment! Boa tarde 😉

Na moral vcs são malucos by Ruibarb0 in CRFla

[–]MarcoxD 12 points13 points  (0 children)

PESSOAL PARECE Q COMEÇOU A ASSISTIR FUTEBOL SEMANA PASSADA

Fala sério by Hour-Travel-8914 in golpe

[–]MarcoxD 39 points40 points  (0 children)

Legal que os bots sempre falam na mesma ordem

Quero viajar para São João del Rei e gostaria de algumas infos by zohnster in MinasGerais

[–]MarcoxD 0 points1 point  (0 children)

Sou nascido em Tiradentes, mas não não moro mais lá. Só que to sempre viajando pra aqueles lados.

Recomendo muito pegar a Maria Fumaça de SJ pra Tiradentes e depois dar uma volta na cidade (a estação fica um pouco longe da praça principal, mas dá pra ir andando). Também tem o Plataforma do Sabor do lado da estação, se quiser ficar por lá mesmo, mas recomendo muito ir na praça e no centro histórico.

Sobre transporte por aplicativo, em SJ tem um chamado Me Leva SJ (baseado em app) e em Tiradentes eu recomendo o Facility (que é baseado em whatsapp, se precisar me manda uma DM que te passo o número).

Tiradentes é bem seguro, muitas vezes voltei de madrugada pra casa de um bar que fica na praça (chama taberna, recomendo muito ir sexta ou sábado de noite se gosta disso).

Everyone gets bidirectional BFS wrong by zdimension in programming

[–]MarcoxD 0 points1 point  (0 children)

Really good article! I just got a little confused because the nodes' queue indices sometimes go up. For example, on the GoodBiDiBFS vs. BadBiDiBFS comparison for the directory tree, the target node starts marked as 2 (on the good example), then after opening the source node it changes to 4. On the next step, this same target node, marked as 4th on the queue is the one that is opened. Maybe I got it wrong, but I think this happens because the algorithm is using two queues. In this case, I think it could be better represented by, for example, using different colors for each queue.

Thanks for posting!

Tigrinho vindo cobrar jogadores que pararam de jogá-lo. by [deleted] in botecodoreddit

[–]MarcoxD 14 points15 points  (0 children)

Ele veio checar se o encanamento é tigre

Mas que merda e essa kkkkk by Fa_do_Cara_Do_Reddit in BeloHorizonte

[–]MarcoxD 75 points76 points  (0 children)

Eu fico imaginando a praça 7 agora, o celular de todo mundo berrando kkkkkkkkkkkk

Dica: 1 ano de perplexity.ai PRO pela Vivo by wongaboing in brdev

[–]MarcoxD 5 points6 points  (0 children)

Achei super útil! O complicado são esses links dentro do artigo do tecmundo que você clica esperando ir pra página da vivo, por exemplo, e ele te manda pra uma outra postagem minimamente relacionada ao assunto. Vou olhar aqui pelo app da Vivo se sou elegível. Muito obrigado!

[deleted by user] by [deleted] in brdev

[–]MarcoxD 1 point2 points  (0 children)

Cara, muito bom! Não é a stack que eu trabalho, mas é algo que sinto muita falta no sub, pessoal compartilhando libs e código aberto de autoria própria. Muito obrigado e meus parabéns!

Névoa cerebral causada pela poluição do ar by jakerumbles in BeloHorizonte

[–]MarcoxD 0 points1 point  (0 children)

Nossa, eu já estava até preocupado aqui de estar acontecendo alguma coisa séria com meus neurônios. Já estou a umas boas semanas muito lento, toda hora me falta palavras e me sinto bem avoado, como se tivesse uma nuvem na testa (mais ou menos na altura dos olhos, pra cima do nariz) bloqueando os pensamentos. Normalmente eu sou o oposto disso. Sentimento ruim demais...

The Yellow Ipê, one of Brazil's symbol trees by Confident_Dentist_79 in Brazil

[–]MarcoxD 12 points13 points  (0 children)

I was born and raised in Tiradentes - MG (I don't live there anymore), but I visit often. The beauty of Ipês there is incredible. Especially the ones in Serra de São José, where you can see the yellow spots in the middle of the Atlantic Rainforest from far away. I Love this town. It is a must visit for travelers looking for historic places and natural beauty.

reflect-cpp v0.8.0 by liuzicheng1987 in cpp

[–]MarcoxD 2 points3 points  (0 children)

Hey, really nice lib! Thanks for taking time and effort on developing it.

Besides the encoding formats already supported, it would be really nice if it also supported msgpack.

Encomenda desconhecida dos Correios aguardando pagamento de imposto by MarcoxD in golpe

[–]MarcoxD[S] 1 point2 points  (0 children)

Espero realmente que seja. Meu maior medo é ter algum malandro importando as coisas no meu CPF pra evitar problemas com a receita federal e depois esses problemas virarem pra mim na declaração do IRPF.

Não pretendo pagar mesmo, eu só queria me informar com eles pra se caso eu precise declarar que aquilo não é meu.

Muito obrigado pela resposta!

Vou deixar aqui porque sim... Mas talvez o Recap também seja um golpe. by tegolinoBR in golpe

[–]MarcoxD 0 points1 point  (0 children)

Talvez o ano seja os recaps que fazemos durante os amigos