1、Using the Thrift RPC Framework in Zephyr2023-06-28:Embedded Open Source SummitChris FriedtEmbedded SWE,MetaThrift Module Maintainerhttps:/bit.ly/442kJrJ Agenda01 What is Thrift?02 Thrift in Zephyr03 Status Update&Additional Work01 What is Thrift?https:/bit.ly/433nA2phttps:/bit.ly/44nXnwq 01 WHAT IS
2、THRIFT?Remote Procedure Call Frameworks RPC is nothing new Solution for ad-hoc,hand-rolled,bit-stuffed“protocols”Solution for re-inventing TCP 1000 x times Reliable asynchronous communication is hard ASN.1(1984,ITU-T)now ISO/IEC 8825-1:2021 Sun RPC(1984-1986,part of NFS)Part of glibc(and others)to t
3、his day(rpcgen)TLV(Tag-Length-Value)representation E.g.Netlink,MISB(oddly I did MISB in Thrift!)Some issues with SunRPC every message(procedure)required a version absolute nightmare for inter-version compatibility Protobufs,Thrift,and gRPC started around the“downfall of Sun”Drop message versions(jus
4、t use new Tag)Do not reuse Tags Guaranteed consistence+/-one rev(mit)01 WHAT IS THRIFT?https:/bit.ly/4411BdP 01 WHAT IS THRIFT?codePrincessThrift History/Internals Created at Facebook(now Meta)2006-2007 Inspired by Protocol Buffers Used extensively throughout Meta infra Released to the ASF in 2007,o
5、riginal whitepaper Adopted by several cloud companies,some OSS projects Not only primitive types such as bool,i32,and double,but also rich types such as enum,list,map,and struct Not only Binary,Compact Binary,but also e.g.JSON Procedures(methods)can throw any kind of struct and take any number of ar
6、guments All OSs,27 Languages,Facebook forked Thrift in 2014 to create fbthrift01 WHAT IS THRIFT?https:/bit.ly/3CS4PV8 https:/bit.ly/443gpse https:/ 02 Thrift in Zephyrhttps:/bit.ly/3Xv60D9 https:/bit.ly/3JvDyeP https:/zephyrproject.org/store/https:/bit.ly/3JxrVUs Thrift ported to Zephyr by Young Mei